summaryrefslogtreecommitdiff
path: root/6
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-12-15 00:20:39 -0800
committerOri Bernstein <ori@eigenstate.org>2015-12-15 00:20:39 -0800
commit3aec3caf0f75feec908fca6e387e7d50ae208d33 (patch)
treeec8428315f7ca6f7b4970b4ea25ddf708e419699 /6
parent994b042eac3300dd62bbbc7dedbb6d9a0b525638 (diff)
downloadmc-3aec3caf0f75feec908fca6e387e7d50ae208d33.tar.gz
Fix matching void union args.
We no longer segfault! Whee!
Diffstat (limited to '6')
-rw-r--r--6/simp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/6/simp.c b/6/simp.c
index c0f3619..b864c2a 100644
--- a/6/simp.c
+++ b/6/simp.c
@@ -256,6 +256,9 @@ static Node *set(Node *a, Node *b)
assert(a != NULL && b != NULL);
assert(exprop(a) == Ovar || exprop(a) == Oderef);
+ if (tybase(exprtype(a))->type == Tyvoid)
+ return a;
+
n = mkexpr(a->loc, Oset, a, b, NULL);
n->expr.type = exprtype(a);
return n;