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())