summaryrefslogtreecommitdiff
path: root/6
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
commitd6882e116c61b3ec3a79c29ceabbafe36196235f (patch)
tree1464ce8ab8490dd7c31290d0a97c9dac17f3a2a5 /6
parent207d86eced0726bf8ce0eaeb6b6e06a40e47a2d9 (diff)
downloadmc-d6882e116c61b3ec3a79c29ceabbafe36196235f.tar.gz
Make arrays/structs/... lvalue expressions.
Diffstat (limited to '6')
-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;