summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--lisc/isel.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lisc/isel.c b/lisc/isel.c
index 80bdae7..e3c3591 100644
--- a/lisc/isel.c
+++ b/lisc/isel.c
@@ -492,7 +492,7 @@ selcall(Fn *fn, Ins *i0, Ins *i1)
 		if ((--a)->inmem) {
 			assert(a->align <= 4);
 			stk += a->size;
-			if (a->align == 4)
+			if (a->align == 4) /* todo, bigger alignments */
 				stk += stk & 15;
 		}
 	stk += stk & 15;
@@ -537,7 +537,7 @@ selcall(Fn *fn, Ins *i0, Ins *i1)
 		if (!a->inmem)
 			continue;
 		sz = a->size;
-		if (a->align == 4 && stk % 16)
+		if (a->align == 4 && (stk-sz) % 16)
 			sz += 8;
 		stk -= sz;
 		if (i->op == OArgc) {