Skip to content

Commit

Permalink
#3367: Extend range check to support negative integers.
Browse files Browse the repository at this point in the history
  • Loading branch information
siegfriedpammer committed Jan 15, 2025
1 parent c226e38 commit 7218a63
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@ bool TransformDecimalCtorToConstant(NewObj inst, out LdcDecimal result)
int lo, mid, hi, isNegative, scale;
if (args[0].MatchLdcI4(out lo) && args[1].MatchLdcI4(out mid) &&
args[2].MatchLdcI4(out hi) && args[3].MatchLdcI4(out isNegative) &&
args[4].MatchLdcI4(out scale) && scale <= 28)
args[4].MatchLdcI4(out scale) && unchecked((byte)scale) <= 28)
{
result = new LdcDecimal(new decimal(lo, mid, hi, isNegative != 0, (byte)scale));
result = new LdcDecimal(new decimal(lo, mid, hi, isNegative != 0, unchecked((byte)scale)));
return true;
}
}
Expand Down

0 comments on commit 7218a63

Please sign in to comment.