summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2018-07-18 22:17:59 -0700
committerOri Bernstein <ori@eigenstate.org>2018-07-18 22:18:30 -0700
commit8a3e8add6e0180565312d1079395ad39de4d9ce3 (patch)
tree95eb634d83859de9cb3a7004633ef9ea93dde110
parent3355f31cb1efe35fab21e39e27c5cadcda93d51d (diff)
downloadmc-8a3e8add6e0180565312d1079395ad39de4d9ce3.tar.gz
Top level anonymous unions may not have their type set.
-rw-r--r--parse/infer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/parse/infer.c b/parse/infer.c
index c208435..c5cb02e 100644
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -514,7 +514,8 @@ tyresolve(Type *t)
case Tyunion:
inaggr++;
for (i = 0; i < t->nmemb; i++) {
- assert(t->udecls[i]->utype);
+ if (!t->udecls[i]->utype)
+ t->udecls[i]->utype = t;
t->udecls[i]->utype = tf(t->udecls[i]->utype);
if (t->udecls[i]->etype) {
tyresolve(t->udecls[i]->etype);