summaryrefslogtreecommitdiff
path: root/mi
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2018-07-01 17:52:21 -0700
committerOri Bernstein <ori@eigenstate.org>2018-07-01 17:52:21 -0700
commit1da035ab2c9e8cbbdda631bfc7023b9bced4e61a (patch)
tree5e4d2f985cc4b1d31c0f6f2281a5e74ecd5215a3 /mi
parentec6e403c3fbefc7929f52610aecb85300e7ad17a (diff)
downloadmc-1da035ab2c9e8cbbdda631bfc7023b9bced4e61a.tar.gz
Make '!=' not hard coded as evaluating to '==' for enum unions.
Oops.
Diffstat (limited to 'mi')
-rw-r--r--mi/flatten.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/mi/flatten.c b/mi/flatten.c
index b746804..022ffe4 100644
--- a/mi/flatten.c
+++ b/mi/flatten.c
@@ -386,7 +386,12 @@ comparecomplex(Flattenctx *s, Node *n, Op op)
r = mkexpr(n->loc, Outag, rval(s, n->expr.args[1]), NULL);
l->expr.type = mktype(n->loc, Tyuint32);
r->expr.type = mktype(n->loc, Tyuint32);
- e = mkexpr(n->loc, Oueq, l, r, NULL);
+ if (op == Oeq)
+ e = mkexpr(n->loc, Oueq, l, r, NULL);
+ else if (op == One)
+ e = mkexpr(n->loc, Oune, l, r, NULL);
+ else
+ fatal(n, "unsupported operator %s for enum union", opstr[op]);
e->expr.type = mktype(n->loc, Tybool);
return e;
}