using System.Runtime.CompilerServices;
sealed class S
{
private static int Sink;
static void Main()
{
Test(new int[6], true);
}
[MethodImpl(MethodImplOptions.NoInlining)]
static int Test(int[] arr, bool c)
{
int prev = arr[5];
int j;
if (c)
{
Sink = 1;
j = -5;
}
else
{
j = 3;
}
return prev + arr[j];
}
}
Expected:
System.IndexOutOfRangeException
Actual:
System.AccessViolationException
Expected:
Actual: