diff options
author | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2015-09-17 19:56:39 -0400 |
---|---|---|
committer | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2015-09-17 19:56:58 -0400 |
commit | 7540024f78e1a40506884adad4803c2fccf154ff (patch) | |
tree | 1b935234846b8968bf977f615f1a1cad98a8ce24 /lisc | |
parent | 559617855a841ebe0dda3ec7f36daf7b36b33d38 (diff) | |
download | roux-7540024f78e1a40506884adad4803c2fccf154ff.tar.gz |
fix two bugs in selpar()
- One missing argument for OAlloc. - One reference shuffling.
Diffstat (limited to 'lisc')
-rw-r--r-- | lisc/isel.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lisc/isel.c b/lisc/isel.c index e69e8eb..a329aa0 100644 --- a/lisc/isel.c +++ b/lisc/isel.c @@ -638,14 +638,15 @@ selpar(Fn *fn, Ins *i0, Ins *i1) ; r1 = newtmp(fn); r = TMP(a->rty[0]); - *curi++ = (Ins){OAlloc+al, 1, r1, {R}}; + r2 = newcon(a->size, fn); + *curi++ = (Ins){OAlloc+al, 1, r1, {r2}}; *curi++ = (Ins){OStorel, 0, R, {r, r1}}; if (a->size > 8) { - r1 = newtmp(fn); + r = newtmp(fn); r2 = newcon(8, fn); - *curi++ = (Ins){OAdd, 1, r1, {r, r2}}; - r = TMP(a->rty[1]); - *curi++ = (Ins){OStorel, 0, R, {r, r1}}; + *curi++ = (Ins){OAdd, 1, r, {r1, r2}}; + r1 = TMP(a->rty[1]); + *curi++ = (Ins){OStorel, 0, R, {r1, r}}; } } for (a=&ac[i1-i0], stk=0; a>ac;) { |