Skip to content

Commit 43c02cd

Browse files
authored
Fix manipulation of signature type context in SVM resolution (#8)
1 parent bc0d894 commit 43c02cd

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/coreclr/vm/methodtable.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9196,6 +9196,7 @@ MethodTable::TryResolveVirtualStaticMethodOnThisType(MethodDesc* pInterfaceMD, B
91969196
IMDInternalImport* pMDInternalImport = GetMDImport();
91979197
HENUMInternalMethodImplHolder hEnumMethodImpl(pMDInternalImport);
91989198
hr = hEnumMethodImpl.EnumMethodImplInitNoThrow(GetCl());
9199+
SigTypeContext sigTypeContext(this);
91999200

92009201
if (FAILED(hr))
92019202
{
@@ -9230,16 +9231,17 @@ MethodTable::TryResolveVirtualStaticMethodOnThisType(MethodDesc* pInterfaceMD, B
92309231
MethodTable *pInterfaceMT = ClassLoader::LoadTypeDefOrRefOrSpecThrowing(
92319232
GetModule(),
92329233
tkParent,
9233-
NULL /*SigTypeContext*/)
9234+
&sigTypeContext)
92349235
.GetMethodTable();
9235-
if (pInterfaceMT != pInterfaceMD->GetMethodTable())
9236+
if (pInterfaceMT != pInterfaceMD->GetMethodTable() &&
9237+
pInterfaceMT->GetCanonicalMethodTable() != pInterfaceMD->GetMethodTable())
92369238
{
92379239
continue;
92389240
}
92399241
MethodDesc *pMethodDecl = MemberLoader::GetMethodDescFromMemberDefOrRefOrSpec(
92409242
GetModule(),
92419243
methodDecl,
9242-
NULL /*SigTypeContext*/,
9244+
&sigTypeContext,
92439245
/* strictMetadataChecks */ FALSE,
92449246
/* allowInstParam */ FALSE);
92459247
if (pMethodDecl == nullptr)
@@ -9253,7 +9255,7 @@ MethodTable::TryResolveVirtualStaticMethodOnThisType(MethodDesc* pInterfaceMD, B
92539255
MethodDesc *pMethodImpl = MemberLoader::GetMethodDescFromMemberDefOrRefOrSpec(
92549256
GetModule(),
92559257
methodBody,
9256-
NULL /*SigTypeContext*/,
9258+
&sigTypeContext,
92579259
/* strictMetadataChecks */ FALSE,
92589260
/* allowInstParam */ FALSE);
92599261
if (pMethodImpl == nullptr)

0 commit comments

Comments
 (0)