Fix spurious exception while compiling optimized code (#83324)
authorMichal Strehovský <MichalStrehovsky@users.noreply.github.com>
Wed, 15 Mar 2023 01:28:51 +0000 (10:28 +0900)
committerGitHub <noreply@github.com>
Wed, 15 Mar 2023 01:28:51 +0000 (10:28 +0900)
When RyuJIT tried to inline an unboxing stub, it would trigger an exception that would abort the inline. Make it so that we don't trigger an exception.

src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs

index fbb17f2..a5badba 100644 (file)
@@ -1181,7 +1181,7 @@ namespace Internal.JitInterface
             if (!_compilation.CanInline(MethodBeingCompiled, method))
                 return false;
 #endif
-            MethodIL methodIL = _compilation.GetMethodIL(method);
+            MethodIL methodIL = method.IsUnboxingThunk() ? null : _compilation.GetMethodIL(method);
             return Get_CORINFO_METHOD_INFO(method, methodIL, info);
         }