From 945d17aff2aa92dd1fbb0304d4ee7ab5ea6ce496 Mon Sep 17 00:00:00 2001 From: lemon Date: Tue, 20 Jun 2023 09:45:26 +0200 Subject: fix cls logic for comparison instrs previously instr.cls always represented the output dataclass. this doesn't work for comparisons because we know the output is always a boolean integer and we care about the actual comparison dataclass. so now .cls represents the operation dataclass, which matches the result class except for comparisons where the result is always KI4V --- c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'c.c') diff --git a/c.c b/c.c index 6db23be..c3297e8 100644 --- a/c.c +++ b/c.c @@ -1520,7 +1520,7 @@ compileexpr(struct function *fn, const struct expr *ex, bool discard) if (discard) return NOREF; ins.l = cvt(fn, ty.t, sub[0].ty.t, ins.l); ins.r = cvt(fn, ty.t, sub[1].ty.t, ins.r); - ins.cls = cls; + ins.cls = type2cls[ty.t]; return addinstr(fn, ins); case ESET: assert(isscalar(ex->ty)); -- cgit v1.2.3