diff options
author | Ori Bernstein <ori@eigenstate.org> | 2016-01-27 22:21:51 -0800 |
---|---|---|
committer | Ori Bernstein <ori@eigenstate.org> | 2016-01-27 22:21:51 -0800 |
commit | 076fef88db990fb1dd8f0650d018035755d0d45b (patch) | |
tree | 21b2df2656ce5cf62e77b1a858ea2ac24f47120b /6 | |
parent | 37bfca6f1d5043a969104037a0dfc4f8956e7c77 (diff) | |
download | mc-076fef88db990fb1dd8f0650d018035755d0d45b.tar.gz |
Only simplify empty array blobs to zero slices.
Diffstat (limited to '6')
-rw-r--r-- | 6/simp.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -1943,11 +1943,13 @@ static void extractsub(Simp *s, Node *e) switch (exprop(e)) { case Oslice: sub = e->expr.args[0]; - if (exprop(sub) == Oarr && sub->expr.nargs > 0) { - e->expr.args[0] = simpblob(s, e->expr.args[0]); - } else { - e->expr.args[0] = mkintlit(e->loc, 0); - e->expr.args[0]->expr.type = tyintptr; + if (exprop(sub) == Oarr) { + if (sub->expr.nargs > 0) { + e->expr.args[0] = simpblob(s, e->expr.args[0]); + } else { + e->expr.args[0] = mkintlit(e->loc, 0); + e->expr.args[0]->expr.type = tyintptr; + } } break; case Oarr: |