diff options
| author | 2026-04-11 12:13:08 +0200 | |
|---|---|---|
| committer | 2026-04-11 12:13:08 +0200 | |
| commit | 116a53553bfc3f5c55fb532550b97be8fab4c200 (patch) | |
| tree | af8f46c770013fae30e092f60e75545d66f48c86 | |
| parent | 87824748c3223f300dae9a725f823da02bff89d9 (diff) | |
x86-64/emit: fix stack arg offset for edgecases
It was wrong for functions that didn't use the frame pointer but took
arguments in the stack
| -rw-r--r-- | src/t_x86-64_emit.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/t_x86-64_emit.c b/src/t_x86-64_emit.c index 616ccf4..6079f3c 100644 --- a/src/t_x86-64_emit.c +++ b/src/t_x86-64_emit.c @@ -1360,7 +1360,6 @@ emitbin(Function *fn) DS("\x55\x48\x89\xE5"); } saverestore = npush = calleesave(pcode, fn); - npush += !frame.usebp; /* ensure stack is 16-byte aligned */ if (frame.usebp) { @@ -1370,6 +1369,8 @@ emitbin(Function *fn) fn->stksiz += 8; frame.size += 8; } + } else { + frame.size = npush*8; } frame.stksiz = fn->stksiz; |