From 0e7a4cbf1d2655240dd2a7e3c289b1b19148cc64 Mon Sep 17 00:00:00 2001 From: lemon Date: Mon, 1 Dec 2025 18:22:38 +0100 Subject: c: narrowing ints of different signedness... --- c/c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'c') diff --git a/c/c.c b/c/c.c index 5dbce20..e669baf 100644 --- a/c/c.c +++ b/c/c.c @@ -3259,7 +3259,7 @@ compileexpr(struct function *fn, const struct expr *ex, bool discard) r = compileexpr(fn, sub, discard); if (discard) return NOREF; r = cvt(fn, ex->ty, sub->ty, r); - if (isint(ex->ty) && typesize(ex->ty) < typesize(sub->ty)) + if (isint(ex->ty) && (typesize(ex->ty) < typesize(sub->ty) || issigned(ex->ty) != issigned(sub->ty))) return narrow(fn, type2cls[scalartypet(ex->ty)], ex->ty, r, 0); return r; case ENEG: -- cgit v1.2.3