diff options
author | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2015-09-11 21:13:35 -0400 |
---|---|---|
committer | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2015-09-15 23:01:33 -0400 |
commit | b5a009347e75df5ccb48736e22dff06ab9194658 (patch) | |
tree | 8d7aa5f89d622039e72976bc83968c59694209fe /lisc | |
parent | 9bb69bf4c7dae1e15fb505e0a54d950f9621df84 (diff) | |
download | roux-b5a009347e75df5ccb48736e22dff06ab9194658.tar.gz |
fix alignment for structs on the stack
Diffstat (limited to 'lisc')
-rw-r--r-- | lisc/isel.c | 4 |
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) { |