summaryrefslogtreecommitdiff
path: root/mi
diff options
context:
space:
mode:
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;
}