1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +02:00

Fixed method slotting when method is already in work list

This commit is contained in:
Brian Fiete 2022-01-27 06:18:11 -05:00
parent 37c4074c44
commit 7e03ce86bc

View file

@ -5636,18 +5636,24 @@ void BfModule::DoTypeInstanceMethodProcessing(BfTypeInstance* typeInstance)
if ((pass == 1) != (methodDef->mIsOverride))
continue;
bool doGetMethodInstance = true;
auto methodInstanceGroup = &typeInstance->mMethodInstanceGroups[methodDef->mIdx];
if ((methodInstanceGroup->mOnDemandKind != BfMethodOnDemandKind_AlwaysInclude) &&
(methodInstanceGroup->mOnDemandKind != BfMethodOnDemandKind_Decl_AwaitingDecl))
{
BfLogSysM("Skipping GetMethodInstance on MethodDef: %p OnDemandKind: %d\n", methodDef, methodInstanceGroup->mOnDemandKind);
continue;
doGetMethodInstance = false;
}
if (methodDef->mMethodType == BfMethodType_Init)
continue;
doGetMethodInstance = false;
BfMethodInstance* methodInstance = NULL;
if (doGetMethodInstance)
{
int prevWorklistSize = (int)mContext->mMethodWorkList.size();
auto flags = ((methodDef->mGenericParams.size() != 0) || (typeInstance->IsUnspecializedType())) ? BfGetMethodInstanceFlag_UnspecializedPass : BfGetMethodInstanceFlag_None;
@ -5657,7 +5663,7 @@ void BfModule::DoTypeInstanceMethodProcessing(BfTypeInstance* typeInstance)
auto moduleMethodInstance = GetMethodInstance(typeInstance, methodDef, BfTypeVector(), flags);
auto methodInstance = moduleMethodInstance.mMethodInstance;
methodInstance = moduleMethodInstance.mMethodInstance;
if (methodInstance == NULL)
{
BF_ASSERT(typeInstance->IsGenericTypeInstance() && (typeInstance->mTypeDef->mIsCombinedPartial));
@ -5729,7 +5735,13 @@ void BfModule::DoTypeInstanceMethodProcessing(BfTypeInstance* typeInstance)
BF_ASSERT(methodInstanceGroup->mOnDemandKind != BfMethodOnDemandKind_Decl_AwaitingReference);
}
}
}
else
{
methodInstance = methodInstanceGroup->mDefault;
if (methodInstance == NULL)
continue;
}
bool methodUsedVirtually = false;
if (typeInstance->IsInterface())