Skip to content

Commit

Permalink
Fix arithmetic conversion from larger unsigned operand type
Browse files Browse the repository at this point in the history
Fixes: 16944a0 ("Arithmetic conversions for unary and binary expressions, bug 231859.")
Closes: #265
  • Loading branch information
i-garrison authored and jonahgraham committed Feb 4, 2023
1 parent cf834dd commit 57008ba
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ private final IType convert(IType type1, IType type2) {
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;
}

Expand Down

0 comments on commit 57008ba

Please sign in to comment.