summaryrefslogtreecommitdiff
path: root/mi
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2018-06-10 12:59:16 -0700
committerOri Bernstein <ori@eigenstate.org>2018-06-10 12:59:16 -0700
commit12da19e4d0545514a36f30bd7db39f428cfa67c5 (patch)
tree298784d9a4e4e8035350c8231cbdbc72dba4fae4 /mi
parentaed73f868fbd7b9774c25031893adda907a9558c (diff)
downloadmc-12da19e4d0545514a36f30bd7db39f428cfa67c5.tar.gz
Correctly float assignments inside function arguments.
Diffstat (limited to 'mi')
-rw-r--r--mi/flatten.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mi/flatten.c b/mi/flatten.c
index fd1c389..fa4bdc1 100644
--- a/mi/flatten.c
+++ b/mi/flatten.c
@@ -441,14 +441,16 @@ compare(Flattenctx *s, Node *n, int fields)
static Node *
assign(Flattenctx *s, Node *lhs, Node *rhs)
{
- Node *r, *t, *u;
+ Node *r, *t, *e, *u;
if (exprop(lhs) == Otup) {
r = destructure(s, lhs, rhs);
} else if (tybase(exprtype(lhs))->type != Tyvoid) {
t = lval(s, lhs);
u = rval(s, rhs);
- r = asn(t, u);
+ e = asn(t, u);
+ append(s, e);
+ r = t;
} else {
r = rval(s, rhs);
}