From 08ac3853365439d5c76d864ed12c11934bff4208 Mon Sep 17 00:00:00 2001 From: EgorBo Date: Sun, 2 Jul 2023 16:11:38 +0200 Subject: [PATCH] Align behavior --- src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs index 43fd2a70b8a66a..9b4ffa837fb201 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs @@ -1183,15 +1183,10 @@ private bool getMethodInfo(CORINFO_METHOD_STRUCT_* ftn, CORINFO_METHOD_INFO* inf { MethodDesc method = HandleToObject(ftn); - if (context != null && method.IsSharedByGenericInstantiations) + if (context != null && method.IsSharedByGenericInstantiations && context != contextFromMethodBeingCompiled()) { TypeSystemEntity ctx = entityFromContext(context); - if (ctx is MethodDesc methodFromCtx && context != contextFromMethodBeingCompiled()) - { - Debug.Assert(method.GetTypicalMethodDefinition() == methodFromCtx.GetTypicalMethodDefinition()); - method = methodFromCtx; - } - else if (ctx is InstantiatedType instantiatedCtxType) + if (ctx is InstantiatedType instantiatedCtxType) { MethodDesc methodTypicalDef = method.GetTypicalMethodDefinition(); if (methodTypicalDef.RequiresInstMethodDescArg())