aboutsummaryrefslogtreecommitdiffhomepage
path: root/ir.c
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2025-10-15 11:18:47 +0200
committerlemon <lsof@mailbox.org>2025-10-15 11:18:47 +0200
commit41483dda42f6eb2ce45b0f8580fc46eacf6390b8 (patch)
treeb804c23ae9f3539234a2d384f991c898760975cb /ir.c
parent347d237a114495c0a9b9d14d38551d544dca021d (diff)
c: fix codegen for enum types
Diffstat (limited to 'ir.c')
-rw-r--r--ir.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ir.c b/ir.c
index 6c28977..f3b6766 100644
--- a/ir.c
+++ b/ir.c
@@ -110,7 +110,8 @@ addcon(const struct xcon *con)
union irtype
mkirtype(union type t)
{
- if (t.t == TYVOID || isscalar(t)) return (union irtype) { .cls = type2cls[t.t] };
+ if (t.t == TYVOID || isscalar(t))
+ return (union irtype) { .cls = type2cls[scalartypet(t)] };
assert(isagg(t));
return (union irtype) { .isagg = 1, .dat = t.dat };
}