aboutsummaryrefslogtreecommitdiffhomepage
path: root/amd64/emit.c
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2025-10-22 10:47:09 +0200
committerlemon <lsof@mailbox.org>2025-10-22 10:47:09 +0200
commit2cfd137e001758887e4f0a64db6f2f4787ff69a4 (patch)
tree73b0af17d9a00e8f31bb0b3820d34717e6b5b026 /amd64/emit.c
parentcfbe79d726ceff1aba98345e4f7b82ec6530bb3b (diff)
fix edge case codegen bugs (w/ stack offsets, spilling)
Diffstat (limited to 'amd64/emit.c')
-rw-r--r--amd64/emit.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/amd64/emit.c b/amd64/emit.c
index f44eb3a..65b67d5 100644
--- a/amd64/emit.c
+++ b/amd64/emit.c
@@ -1189,7 +1189,9 @@ emitbin(struct function *fn)
/* ensure stack is 16-byte aligned for function calls */
if (!fn->isleaf && ((fn->stksiz + npush*8) & 0xF) != 0x8) {
+ assert(usebp);
fn->stksiz += 8;
+ rbpoff -= 4;
}
if (fn->stksiz != 0) {