mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 19:48:20 +02:00
Fixed a PopulateType reentry issue
This commit is contained in:
parent
accc74957a
commit
66aeb0a302
1 changed files with 17 additions and 5 deletions
|
@ -1467,12 +1467,20 @@ bool BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
|
|||
if (typeInstance->mResolvingConstField)
|
||||
return !typeInstance->mTypeFailed;
|
||||
|
||||
auto _CheckTypeDone = [&]()
|
||||
{
|
||||
if (typeInstance->mNeedsMethodProcessing)
|
||||
{
|
||||
BF_ASSERT(typeInstance->mDefineState >= BfTypeDefineState_Defined);
|
||||
if ((canDoMethodProcessing) && (populateType >= BfPopulateType_DataAndMethods))
|
||||
DoTypeInstanceMethodProcessing(typeInstance);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
if (_CheckTypeDone())
|
||||
return true;
|
||||
|
||||
// Partial population break out point
|
||||
if ((populateType >= BfPopulateType_Identity) && (populateType <= BfPopulateType_IdentityNoRemapAlias))
|
||||
|
@ -1509,6 +1517,9 @@ bool BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
|
|||
BuildGenericParams(resolvedTypeRef);
|
||||
}
|
||||
|
||||
if (_CheckTypeDone())
|
||||
return true;
|
||||
|
||||
// Don't do TypeToString until down here. Otherwise we can infinitely loop on BuildGenericParams
|
||||
|
||||
bool isStruct = resolvedTypeRef->IsStruct();
|
||||
|
@ -2108,6 +2119,7 @@ bool BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
|
|||
}
|
||||
}
|
||||
|
||||
BF_ASSERT(!typeInstance->mNeedsMethodProcessing);
|
||||
typeInstance->mDefineState = BfTypeDefineState_HasInterfaces;
|
||||
if (populateType <= BfPopulateType_Interfaces)
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue