diff --git a/ICSharpCode.Decompiler/IL/Transforms/EarlyExpressionTransforms.cs b/ICSharpCode.Decompiler/IL/Transforms/EarlyExpressionTransforms.cs index 2316732e90..fdfc276656 100644 --- a/ICSharpCode.Decompiler/IL/Transforms/EarlyExpressionTransforms.cs +++ b/ICSharpCode.Decompiler/IL/Transforms/EarlyExpressionTransforms.cs @@ -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; } }