Skip to content

Commit 3630bec

Browse files
committed
Avoid promote-to-int in equality checking
1 parent 3c20c46 commit 3630bec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cc/frontend/expr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1209,7 +1209,7 @@ Expr *make_expr_cmp(enum ExprKind kind, const Token *tok, Expr *lhs, Expr *rhs)
12091209
} else {
12101210
bool lu = lt->fixnum.is_unsigned;
12111211
bool ru = rt->fixnum.is_unsigned;
1212-
make_int = lu != ru;
1212+
make_int = lu != ru && kind > EX_NE;
12131213
}
12141214
}
12151215
if (!(is_fixnum(lt) && is_fixnum(rt)) || !(lc || rc)) {

0 commit comments

Comments
 (0)