mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 20:12:21 +02:00
Fixed crash with illegal recursive generic definitions
This commit is contained in:
parent
3cdc70c1be
commit
fda6c326c0
1 changed files with 29 additions and 21 deletions
|
@ -3403,6 +3403,7 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
|
|||
|
||||
for (auto& validateEntry : deferredTypeValidateList)
|
||||
{
|
||||
SetAndRestoreValue<BfTypeReference*> prevAttributeTypeRef(typeState.mCurAttributeTypeRef, validateEntry.mTypeRef);
|
||||
SetAndRestoreValue<bool> ignoreErrors(mIgnoreErrors, mIgnoreErrors | validateEntry.mIgnoreErrors);
|
||||
ValidateGenericConstraints(validateEntry.mTypeRef, validateEntry.mGenericType, false);
|
||||
}
|
||||
|
@ -4331,6 +4332,12 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
|
|||
}
|
||||
|
||||
if ((mCompiler->mOptions.mAllowHotSwapping) && (typeInstance->mDefineState < BfTypeDefineState_Defined))
|
||||
{
|
||||
if (typeInstance->mHotTypeData == NULL)
|
||||
{
|
||||
BF_ASSERT(typeInstance->mTypeFailed);
|
||||
}
|
||||
else
|
||||
{
|
||||
auto hotTypeVersion = typeInstance->mHotTypeData->mTypeVersions.back();
|
||||
|
||||
|
@ -4361,6 +4368,7 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
|
|||
for (auto member : hotTypeVersion->mMembers)
|
||||
member->mRefCount++;
|
||||
}
|
||||
}
|
||||
|
||||
if (typeInstance->mDefineState < BfTypeDefineState_Defined)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue