using System.Runtime.CompilerServices;
using System.Linq.Expressions;
internal static class Program
{
public static int Main()
{
try
{
uint result = Test(1, uint.MaxValue);
Console.WriteLine(result);
return result == 0 ? 100 : 1;
}
catch (Exception exception)
{
Console.WriteLine(exception);
return 2;
}
}
[MethodImpl(MethodImplOptions.NoInlining)]
private static uint Test(uint x, uint y)
{
uint result = checked(y + unchecked((byte)x));
if (x == 0)
{
return result + 1;
}
return result;
}
}
Tier0: System.OverflowException: Arithmetic operation resulted in an overflow.
Tier1: 0
Tier0:
System.OverflowException: Arithmetic operation resulted in an overflow.Tier1:
0