aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/t_x86-64_emit.c
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2026-04-12 13:02:22 +0200
committerlemon <lsof@mailbox.org>2026-04-12 13:02:22 +0200
commit5886346cf680c5011de282d00c6f0b2d10431171 (patch)
tree1d63565e6bfa5e0522d534e8bbae6b12a2509bab /src/t_x86-64_emit.c
parentd23aeebff59a762b718fa46de96a8c2e23b6c3f7 (diff)
get rid of other warnings
Diffstat (limited to 'src/t_x86-64_emit.c')
-rw-r--r--src/t_x86-64_emit.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/t_x86-64_emit.c b/src/t_x86-64_emit.c
index 6079f3c..06ad803 100644
--- a/src/t_x86-64_emit.c
+++ b/src/t_x86-64_emit.c
@@ -1344,7 +1344,6 @@ emitbin(Function *fn)
Block *blk;
uchar **pcode = &objout.code;
int npush = 0;
- bool saverestore;
nops(pcode, 16);
fnstart = *pcode;
@@ -1359,7 +1358,7 @@ emitbin(Function *fn)
/* push rbp; mov rbp, rsp */
DS("\x55\x48\x89\xE5");
}
- saverestore = npush = calleesave(pcode, fn);
+ npush = calleesave(pcode, fn);
/* ensure stack is 16-byte aligned */
if (frame.usebp) {
@@ -1439,9 +1438,9 @@ emitbin(Function *fn)
if (blk->lnext != fn->entry && blk->lnext->jmp.t == Jret && blk->lnext->ins.n == 0)
continue; /* fallthru to next blk's RET */
/* epilogue */
- if (fn->stksiz && saverestore && frame.usebp)
+ if (fn->stksiz > 0 && npush > 0 && frame.usebp)
Xadd(pcode, KPTR, mkoper(OREG, .reg = RSP), mkoper(OIMM, .imm = fn->stksiz));
- if (saverestore)
+ if (npush > 0)
calleerestore(pcode, fn);
if (frame.usebp) B(0xC9); /* leave */
B(0xC3); /* ret */