1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 17:35:35 +02:00

Fix arithmetic conversion from larger unsigned operand type

Fixes: 16944a0de7 ("Arithmetic conversions for unary and binary expressions, bug 231859.")
Closes: https://github.com/eclipse-cdt/cdt/issues/265
This commit is contained in:
Igor V. Kovalenko 2023-01-30 23:16:04 +03:00 committed by Jonah Graham
parent cf834dd838
commit 57008babd8

View file

@ -201,8 +201,8 @@ public abstract class ArithmeticConversion {
return unsignedType;
}
// The signed has the higher rank.
if (signedRank.ordinal() > unsignedRank.ordinal()) {
// The signed has the higher rank, check if signed type can represent all unsigned values
if (fitsIntoType(signedType, unsignedType)) {
return signedType;
}