diff options
author | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2016-04-13 11:44:04 -0400 |
---|---|---|
committer | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2016-04-13 12:39:57 -0400 |
commit | af3363a79695c9f56e3cede129c340676f2f93d7 (patch) | |
tree | 1863dde32d5bd0aac0f2c6afd4a1220b0863225e /sysv.c | |
parent | 491c55e6e0295904c8c5f996503b4e8b9e2e180c (diff) | |
download | roux-af3363a79695c9f56e3cede129c340676f2f93d7.tar.gz |
turn alignment asserts into err()
Diffstat (limited to 'sysv.c')
-rw-r--r-- | sysv.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sysv.c b/sysv.c index 25d9859..d15e556 100644 --- a/sysv.c +++ b/sysv.c @@ -278,7 +278,8 @@ selcall(Fn *fn, Ins *i0, Ins *i1, RAlloc **rap) for (stk=0, a=&ac[i1-i0]; a>ac;) if ((--a)->inmem) { - assert(a->align <= 4); + if (a->align > 4) + err("sysv abi requires alignments of 16 or less"); stk += a->size; if (a->align == 4) stk += stk & 15; @@ -414,7 +415,8 @@ selpar(Fn *fn, Ins *i0, Ins *i1) for (i=i0, a=ac, s=4; i<i1; i++, a++) { switch (a->inmem) { case 1: - assert(a->align <= 4); + if (a->align > 4) + err("sysv abi requires alignments of 16 or less"); if (a->align == 4) s = (s+3) & -4; fn->tmp[i->to.val].slot = -s; |