summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-05-02 21:51:59 -0700
committerOri Bernstein <ori@eigenstate.org>2015-05-02 21:51:59 -0700
commitf70fca78dcaf6e70bd8ea03fbc3b50fb2f063c62 (patch)
tree1464ce8ab8490dd7c31290d0a97c9dac17f3a2a5
parente1cb8a75f37babfc565d119e5331bd83f42eb389 (diff)
downloadmc-f70fca78dcaf6e70bd8ea03fbc3b50fb2f063c62.tar.gz
Make arrays/structs/... lvalue expressions.
-rw-r--r--6/simp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/6/simp.c b/6/simp.c
index 2f8dc4b..62899a9 100644
--- a/6/simp.c
+++ b/6/simp.c
@@ -815,7 +815,10 @@ static Node *lval(Simp *s, Node *n)
case Ovar: r = n; break;
case Oidx: r = deref(idxaddr(s, args[0], args[1]), NULL); break;
case Oderef: r = deref(rval(s, args[0], NULL), NULL); break;
- case Omemb: r = deref(membaddr(s, n), NULL); break;
+ case Omemb: r = rval(s, n, NULL); break;
+ case Ostruct: r = rval(s, n, NULL); break;
+ case Oucon: r = rval(s, n, NULL); break;
+ case Oarr: r = rval(s, n, NULL); break;
default:
fatal(n, "%s cannot be an lvalue", opstr[exprop(n)]);
break;