summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichal Strehovský <MichalStrehovsky@users.noreply.github.com>2019-01-18 11:18:56 +0100
committerGitHub <noreply@github.com>2019-01-18 11:18:56 +0100
commit0a2596ce3d7fb0253f30b2461fa910c65840f9b3 (patch)
tree2b7c05ea4daae798b6840a27f764d42fcb706717 /src
parent49aeb8588a07a6f3a6e73aa9225f019724d90290 (diff)
downloadcoreclr-0a2596ce3d7fb0253f30b2461fa910c65840f9b3.tar.gz
coreclr-0a2596ce3d7fb0253f30b2461fa910c65840f9b3.tar.bz2
coreclr-0a2596ce3d7fb0253f30b2461fa910c65840f9b3.zip
Use correct resolution scope when checking default implementations (#22036)
We need to use the module of the interface. Fixes #22021.
Diffstat (limited to 'src')
-rw-r--r--src/vm/methodtablebuilder.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/vm/methodtablebuilder.cpp b/src/vm/methodtablebuilder.cpp
index e47474c8e9..688d98ac90 100644
--- a/src/vm/methodtablebuilder.cpp
+++ b/src/vm/methodtablebuilder.cpp
@@ -10787,6 +10787,8 @@ BOOL MethodTableBuilder::HasDefaultInterfaceImplementation(bmtRTType *pDeclType,
{
bmtRTType * pCurItf = bmtInterface->pInterfaceMap[i].GetInterfaceType();
+ Module * pCurIntfModule = pCurItf->GetMethodTable()->GetModule();
+
// Go over the methods on the interface
MethodTable::IntroducedMethodIterator methIt(pCurItf->GetMethodTable());
for (; methIt.IsValid(); methIt.Next())
@@ -10810,11 +10812,11 @@ BOOL MethodTableBuilder::HasDefaultInterfaceImplementation(bmtRTType *pDeclType,
// Find out what interface this default implementation is implementing
mdToken tkParent;
- IfFailThrow(GetModule()->GetMDImport()->GetParentToken(it.GetToken(), &tkParent));
+ IfFailThrow(pCurIntfModule->GetMDImport()->GetParentToken(it.GetToken(), &tkParent));
// We can only load the approximate interface at this point
MethodTable * pPotentialInterfaceMT = ClassLoader::LoadTypeDefOrRefOrSpecThrowing(
- GetModule(),
+ pCurIntfModule,
tkParent,
&bmtGenerics->typeContext,
ClassLoader::ThrowIfNotFound,
@@ -10831,7 +10833,7 @@ BOOL MethodTableBuilder::HasDefaultInterfaceImplementation(bmtRTType *pDeclType,
return TRUE;
// If this is generic, we need to compare under substitutions
- Substitution curItfSubs(tkParent, GetModule(), &pCurItf->GetSubstitution());
+ Substitution curItfSubs(tkParent, pCurIntfModule, &pCurItf->GetSubstitution());
// Type Equivalence is not respected for this comparision as you can have multiple type equivalent interfaces on a class
TokenPairList newVisited = TokenPairList::AdjustForTypeEquivalenceForbiddenScope(NULL);