mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
Fixed erroneous data cycle detection in unions
This commit is contained in:
parent
cf878097fe
commit
fd001a2f69
3 changed files with 12 additions and 5 deletions
|
@ -2642,8 +2642,8 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
|
|||
|
||||
if (typeInstance->mIsFinishingType)
|
||||
{
|
||||
// This type already failed
|
||||
return;
|
||||
if (typeInstance->mTypeFailed)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!typeInstance->mTypeFailed)
|
||||
|
@ -3736,7 +3736,12 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
|
|||
|
||||
if (populateChildType)
|
||||
{
|
||||
BF_ASSERT(!resolvedFieldType->IsDataIncomplete());
|
||||
if (resolvedFieldType->IsFinishingType())
|
||||
{
|
||||
AssertErrorState();
|
||||
}
|
||||
else
|
||||
BF_ASSERT(!resolvedFieldType->IsDataIncomplete());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -1686,7 +1686,7 @@ BfType* BfTypeInstance::GetUnionInnerType(bool* wantSplat)
|
|||
{
|
||||
SetAndRestoreValue<BfFieldDef*> prevTypeRef(mContext->mCurTypeState->mCurFieldDef, fieldDef);
|
||||
|
||||
mModule->PopulateType(checkInnerType);
|
||||
mModule->PopulateType(checkInnerType, checkInnerType->IsValueType() ? BfPopulateType_Data : BfPopulateType_Declaration);
|
||||
if (checkInnerType->mSize > unionSize)
|
||||
unionSize = checkInnerType->mSize;
|
||||
|
||||
|
@ -2196,7 +2196,7 @@ bool BfTypeInstance::WantsGCMarking()
|
|||
return true;
|
||||
if ((IsEnum()) && (!IsPayloadEnum()))
|
||||
return false;
|
||||
BF_ASSERT(mDefineState >= BfTypeDefineState_Defined);
|
||||
BF_ASSERT((mDefineState >= BfTypeDefineState_Defined) || (mTypeFailed));
|
||||
return mWantsGCMarking;
|
||||
}
|
||||
|
||||
|
|
|
@ -501,6 +501,7 @@ public:
|
|||
virtual bool HasBeenReferenced() { return mDefineState != BfTypeDefineState_Undefined; }
|
||||
virtual bool HasTypeFailed() { return false; }
|
||||
virtual bool IsDataIncomplete() { return mDefineState == BfTypeDefineState_Undefined; }
|
||||
virtual bool IsFinishingType() { return false; }
|
||||
virtual bool IsIncomplete() { return mDefineState < BfTypeDefineState_Defined; }
|
||||
virtual bool IsDeleting() { return ((mRebuildFlags & (BfTypeRebuildFlag_Deleted | BfTypeRebuildFlag_DeleteQueued)) != 0); }
|
||||
virtual bool IsDeclared() { return mDefineState >= BfTypeDefineState_Declared; }
|
||||
|
@ -1954,6 +1955,7 @@ public:
|
|||
virtual bool IsReified() override { return mIsReified; }
|
||||
virtual bool NeedsExplicitAlignment() override { return !IsSizeAligned() || mIsPacked; }
|
||||
virtual bool IsDataIncomplete() override { return ((mTypeIncomplete) || (mBaseTypeMayBeIncomplete)) && (!mNeedsMethodProcessing); }
|
||||
virtual bool IsFinishingType() override { return mIsFinishingType; }
|
||||
virtual bool IsIncomplete() override { return (mTypeIncomplete) || (mBaseTypeMayBeIncomplete); }
|
||||
virtual bool IsSplattable() override { BF_ASSERT((mInstSize >= 0) || (!IsComposite())); return mIsSplattable; }
|
||||
virtual int GetSplatCount() override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue