mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 03:52:19 +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)
|
if (typeInstance->mResolvingConstField)
|
||||||
return !typeInstance->mTypeFailed;
|
return !typeInstance->mTypeFailed;
|
||||||
|
|
||||||
|
auto _CheckTypeDone = [&]()
|
||||||
|
{
|
||||||
if (typeInstance->mNeedsMethodProcessing)
|
if (typeInstance->mNeedsMethodProcessing)
|
||||||
{
|
{
|
||||||
|
BF_ASSERT(typeInstance->mDefineState >= BfTypeDefineState_Defined);
|
||||||
if ((canDoMethodProcessing) && (populateType >= BfPopulateType_DataAndMethods))
|
if ((canDoMethodProcessing) && (populateType >= BfPopulateType_DataAndMethods))
|
||||||
DoTypeInstanceMethodProcessing(typeInstance);
|
DoTypeInstanceMethodProcessing(typeInstance);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
|
if (_CheckTypeDone())
|
||||||
|
return true;
|
||||||
|
|
||||||
// Partial population break out point
|
// Partial population break out point
|
||||||
if ((populateType >= BfPopulateType_Identity) && (populateType <= BfPopulateType_IdentityNoRemapAlias))
|
if ((populateType >= BfPopulateType_Identity) && (populateType <= BfPopulateType_IdentityNoRemapAlias))
|
||||||
|
@ -1509,6 +1517,9 @@ bool BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
|
||||||
BuildGenericParams(resolvedTypeRef);
|
BuildGenericParams(resolvedTypeRef);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_CheckTypeDone())
|
||||||
|
return true;
|
||||||
|
|
||||||
// Don't do TypeToString until down here. Otherwise we can infinitely loop on BuildGenericParams
|
// Don't do TypeToString until down here. Otherwise we can infinitely loop on BuildGenericParams
|
||||||
|
|
||||||
bool isStruct = resolvedTypeRef->IsStruct();
|
bool isStruct = resolvedTypeRef->IsStruct();
|
||||||
|
@ -2108,6 +2119,7 @@ bool BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BF_ASSERT(!typeInstance->mNeedsMethodProcessing);
|
||||||
typeInstance->mDefineState = BfTypeDefineState_HasInterfaces;
|
typeInstance->mDefineState = BfTypeDefineState_HasInterfaces;
|
||||||
if (populateType <= BfPopulateType_Interfaces)
|
if (populateType <= BfPopulateType_Interfaces)
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue