1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +02:00

Fixed interface link error when base class is not instantiated

This commit is contained in:
Brian Fiete 2020-05-09 06:46:29 -07:00
parent b094bf4002
commit 1aa66761ad

View file

@ -4948,7 +4948,16 @@ void BfCompiler::PopulateReified()
} }
} }
for (auto& ifaceTypeInst : typeInst->mInterfaces) auto checkType = typeInst;
while (checkType != NULL)
{
if ((checkType != typeInst) && (checkType->mHasBeenInstantiated))
{
// We will already check this type here in its own loop
break;
}
for (auto& ifaceTypeInst : checkType->mInterfaces)
{ {
auto ifaceInst = ifaceTypeInst.mInterfaceType; auto ifaceInst = ifaceTypeInst.mInterfaceType;
int startIdx = ifaceTypeInst.mStartInterfaceTableIdx; int startIdx = ifaceTypeInst.mStartInterfaceTableIdx;
@ -4961,17 +4970,20 @@ void BfCompiler::PopulateReified()
if ((ifaceMethodInst == NULL) || (!ifaceMethodInst->IsReifiedAndImplemented())) if ((ifaceMethodInst == NULL) || (!ifaceMethodInst->IsReifiedAndImplemented()))
continue; continue;
auto implMethodRef = &typeInst->mInterfaceMethodTable[iMethodIdx + startIdx].mMethodRef; auto implMethodRef = &checkType->mInterfaceMethodTable[iMethodIdx + startIdx].mMethodRef;
BfMethodInstance* implMethod = *implMethodRef; BfMethodInstance* implMethod = *implMethodRef;
if (implMethod == NULL) if (implMethod == NULL)
continue; continue;
if (!implMethod->IsReifiedAndImplemented()) if (!implMethod->IsReifiedAndImplemented())
{ {
didWork = true; didWork = true;
typeInst->mModule->GetMethodInstance(implMethod); checkType->mModule->GetMethodInstance(implMethod);
} }
} }
} }
checkType = checkType->mBaseType;
}
} }
} }