summaryrefslogtreecommitdiff
path: root/6/simp.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2016-01-27 22:21:51 -0800
committerOri Bernstein <ori@eigenstate.org>2016-01-27 22:21:51 -0800
commit076fef88db990fb1dd8f0650d018035755d0d45b (patch)
tree21b2df2656ce5cf62e77b1a858ea2ac24f47120b /6/simp.c
parent37bfca6f1d5043a969104037a0dfc4f8956e7c77 (diff)
downloadmc-076fef88db990fb1dd8f0650d018035755d0d45b.tar.gz
Only simplify empty array blobs to zero slices.
Diffstat (limited to '6/simp.c')
-rw-r--r--6/simp.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/6/simp.c b/6/simp.c
index 12e1cf5..96630d3 100644
--- a/6/simp.c
+++ b/6/simp.c
@@ -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: