aboutsummaryrefslogtreecommitdiffhomepage
path: root/c/c.c
diff options
context:
space:
mode:
author lemon<lsof@mailbox.org>2025-12-01 18:22:38 +0100
committer lemon<lsof@mailbox.org>2025-12-01 18:22:38 +0100
commit0e7a4cbf1d2655240dd2a7e3c289b1b19148cc64 (patch)
tree900bd8525e6294394f911e96bc77ef287da2b41d /c/c.c
parent7135b43053b3edec3a2c0e3b3f2674581a599995 (diff)
c: narrowing ints of different signedness...
Diffstat (limited to 'c/c.c')
-rw-r--r--c/c.c2
1 files changed, 1 insertions, 1 deletions
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: