summaryrefslogtreecommitdiff
path: root/parse/fold.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-02-14 23:35:39 -0800
committerOri Bernstein <ori@eigenstate.org>2017-02-14 23:35:39 -0800
commit3ff9e5e0a03fa26113c7968878ac248f0e3464ef (patch)
tree1d128a0eaa18313c30bde215ab739fb9bb541c6a /parse/fold.c
parent41e2a4f9b568b784c97b285c908409d8879a42a4 (diff)
downloadmc-3ff9e5e0a03fa26113c7968878ac248f0e3464ef.tar.gz
Fold Oudata.
Diffstat (limited to 'parse/fold.c')
-rw-r--r--parse/fold.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/parse/fold.c b/parse/fold.c
index 66d8d43..b931a08 100644
--- a/parse/fold.c
+++ b/parse/fold.c
@@ -142,6 +142,11 @@ Node *fold(Node *n, int foldvar)
uc = finducon(tybase(exprtype(args[0])), args[0]->expr.args[0]);
r = val(n->loc, uc->id, exprtype(n));
break;
+ case Oudata:
+ if (exprop(args[0]) != Oucon || args[0]->expr.nargs != 2)
+ break;
+ r = args[0]->expr.args[1];
+ break;
case Ovar:
if (foldvar && issmallconst(decls[n->expr.did]))
r = fold(decls[n->expr.did]->decl.init, foldvar);