summary refs log tree commit diff
path: root/lisc
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-09-11 21:13:35 -0400
committerQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-09-15 23:01:33 -0400
commitb5a009347e75df5ccb48736e22dff06ab9194658 (patch)
tree8d7aa5f89d622039e72976bc83968c59694209fe /lisc
parent9bb69bf4c7dae1e15fb505e0a54d950f9621df84 (diff)
downloadroux-b5a009347e75df5ccb48736e22dff06ab9194658.tar.gz
fix alignment for structs on the stack
Diffstat (limited to 'lisc')
-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) {