Skip to content

Commit 3f098f3

Browse files
authored
Merge pull request rswier#32 from nubok/patch-2
Avoid undefined behavior - bp is initialized when setting up the stack
2 parents 567db57 + 6884cb4 commit 3f098f3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: c4.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ int main(int argc, char **argv)
463463
if (src) return 0;
464464

465465
// setup stack
466-
sp = (int *)((int)sp + poolsz);
466+
bp = sp = (int *)((int)sp + poolsz);
467467
*--sp = EXIT; // call exit if main returns
468468
*--sp = PSH; t = sp;
469469
*--sp = argc;

0 commit comments

Comments
 (0)