aboutsummaryrefslogtreecommitdiffhomepage
path: root/ir/fold.c
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2026-02-28 09:15:15 +0100
committerlemon <lsof@mailbox.org>2026-02-28 09:27:07 +0100
commitc739270317a409ac4c4782dabd5f9ff82d200045 (patch)
treea99e656bd26dd2ae7faae56b0f931bec9972cb45 /ir/fold.c
parentc0db7d92c14b242daf008f7e3731a5d080e23fa1 (diff)
backend: fix edgecases where imm32 immediate overflows
Diffstat (limited to 'ir/fold.c')
-rw-r--r--ir/fold.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/ir/fold.c b/ir/fold.c
index 321797b..c87ca4d 100644
--- a/ir/fold.c
+++ b/ir/fold.c
@@ -49,6 +49,7 @@ foldint(enum op op, enum irclass k, union ref lr, union ref rr)
case Ougte: x = l.u >= r.u; break;
default: assert(0);
}
+ if (cls2siz[k] < 8) x = (int)x;
return mkintcon(k, x);
}