diff options
author | Ori Bernstein <ori@eigenstate.org> | 2015-12-14 23:56:22 -0800 |
---|---|---|
committer | Ori Bernstein <ori@eigenstate.org> | 2015-12-14 23:56:22 -0800 |
commit | 64a7a7346e02999cf451ee45220b86ba7c69c56f (patch) | |
tree | f3f7bd38dcf22cec27ba497c8ce35d1fc1ae663e | |
parent | 49198982626db8548eba7342c259e302af9585f6 (diff) | |
download | mc-64a7a7346e02999cf451ee45220b86ba7c69c56f.tar.gz |
Don't eliminate side effects on void assign.
The last changes would drop void assignments as they
could have no side effects. Unfortunately, this also meant
that the side effects of the arguments would be dropped.
-rw-r--r-- | 6/simp.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -1540,8 +1540,12 @@ static Node *rval(Simp *s, Node *n, Node *dst) append(s, mkexpr(n->loc, Oret, NULL)); break; case Oasn: - if (tybase(exprtype(n))->type != Tyvoid) + if (tybase(exprtype(n))->type == Tyvoid) { + if (!ispure(args[1])) + r = rval(s, args[1], NULL); + } else { r = assign(s, args[0], args[1]); + } break; case Ocall: r = simpcall(s, n, dst); |