Repro
using System;
using System.Runtime.CompilerServices;
class Program
{
static int[,] s_md = new int[3, 4];
[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)]
static string Test()
{
try { return s_md.GetLength(-1).ToString(); }
catch (Exception e) { return e.GetType().Name; }
}
static void Main() => Console.WriteLine(Test());
}
Expected
Actual
Assert failure(PID 110488 [0x0001af98], Thread: 82424 [0x141f8]): Assertion failed '(unsigned int)dimValue == dimValue' in 'Program:Test():System.String' during 'Importation' (IL size 37; hash 0xe4e107d8; FullOpts)
File: C:\prj\runtime-main3\src\coreclr\jit\importercalls.cpp:5381
The process aborts with exit code 0xC0000602.
Platform
Windows x64, local Checked build of dotnet/runtime main (ef97eb5). Not target-specific.
Requires a Checked/Debug JIT; a Release JIT throws IndexOutOfRangeException correctly.
Repro
Expected
Actual
The process aborts with exit code
0xC0000602.Platform
Windows x64, local Checked build of dotnet/runtime main (ef97eb5). Not target-specific.
Requires a Checked/Debug JIT; a Release JIT throws
IndexOutOfRangeExceptioncorrectly.