1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-22 17:48:01 +02:00

Fix for CheckMethod vtable check in autocomplete

This commit is contained in:
Brian Fiete 2022-07-02 12:09:33 -07:00
parent 066a83e60b
commit 32cfb8733f

View file

@ -1673,6 +1673,13 @@ bool BfMethodMatcher::CheckMethod(BfTypeInstance* targetTypeInstance, BfTypeInst
if ((methodInstance->mVirtualTableIdx < targetTypeInstance->mVirtualMethodTable.mSize) && (methodInstance->mVirtualTableIdx >= 0)) if ((methodInstance->mVirtualTableIdx < targetTypeInstance->mVirtualMethodTable.mSize) && (methodInstance->mVirtualTableIdx >= 0))
{ {
BfVirtualMethodEntry& vEntry = targetTypeInstance->mVirtualMethodTable[methodInstance->mVirtualTableIdx]; BfVirtualMethodEntry& vEntry = targetTypeInstance->mVirtualMethodTable[methodInstance->mVirtualTableIdx];
if ((vEntry.mImplementingMethod.mTypeInstance != NULL) && (vEntry.mImplementingMethod.mTypeInstance->mDefineState < BfTypeDefineState_DefinedAndMethodsSlotted) &&
(mModule->mCompiler->IsAutocomplete()))
{
// Silently ignore
}
else
{
auto implMethod = (BfMethodInstance*)vEntry.mImplementingMethod; auto implMethod = (BfMethodInstance*)vEntry.mImplementingMethod;
if ((implMethod != methodInstance) && (implMethod != NULL)) if ((implMethod != methodInstance) && (implMethod != NULL))
{ {
@ -1680,6 +1687,7 @@ bool BfMethodMatcher::CheckMethod(BfTypeInstance* targetTypeInstance, BfTypeInst
return CheckMethod(targetTypeInstance, implMethod->GetOwner(), implMethod->mMethodDef, isFailurePass); return CheckMethod(targetTypeInstance, implMethod->GetOwner(), implMethod->mMethodDef, isFailurePass);
} }
} }
}
else else
{ {
// Being in autocomplete mode is the only excuse for not having the virtual method table slotted // Being in autocomplete mode is the only excuse for not having the virtual method table slotted