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,7 +2642,7 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
|
||||||
|
|
||||||
if (typeInstance->mIsFinishingType)
|
if (typeInstance->mIsFinishingType)
|
||||||
{
|
{
|
||||||
// This type already failed
|
if (typeInstance->mTypeFailed)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3736,6 +3736,11 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
|
||||||
|
|
||||||
if (populateChildType)
|
if (populateChildType)
|
||||||
{
|
{
|
||||||
|
if (resolvedFieldType->IsFinishingType())
|
||||||
|
{
|
||||||
|
AssertErrorState();
|
||||||
|
}
|
||||||
|
else
|
||||||
BF_ASSERT(!resolvedFieldType->IsDataIncomplete());
|
BF_ASSERT(!resolvedFieldType->IsDataIncomplete());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -1686,7 +1686,7 @@ BfType* BfTypeInstance::GetUnionInnerType(bool* wantSplat)
|
||||||
{
|
{
|
||||||
SetAndRestoreValue<BfFieldDef*> prevTypeRef(mContext->mCurTypeState->mCurFieldDef, fieldDef);
|
SetAndRestoreValue<BfFieldDef*> prevTypeRef(mContext->mCurTypeState->mCurFieldDef, fieldDef);
|
||||||
|
|
||||||
mModule->PopulateType(checkInnerType);
|
mModule->PopulateType(checkInnerType, checkInnerType->IsValueType() ? BfPopulateType_Data : BfPopulateType_Declaration);
|
||||||
if (checkInnerType->mSize > unionSize)
|
if (checkInnerType->mSize > unionSize)
|
||||||
unionSize = checkInnerType->mSize;
|
unionSize = checkInnerType->mSize;
|
||||||
|
|
||||||
|
@ -2196,7 +2196,7 @@ bool BfTypeInstance::WantsGCMarking()
|
||||||
return true;
|
return true;
|
||||||
if ((IsEnum()) && (!IsPayloadEnum()))
|
if ((IsEnum()) && (!IsPayloadEnum()))
|
||||||
return false;
|
return false;
|
||||||
BF_ASSERT(mDefineState >= BfTypeDefineState_Defined);
|
BF_ASSERT((mDefineState >= BfTypeDefineState_Defined) || (mTypeFailed));
|
||||||
return mWantsGCMarking;
|
return mWantsGCMarking;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -501,6 +501,7 @@ public:
|
||||||
virtual bool HasBeenReferenced() { return mDefineState != BfTypeDefineState_Undefined; }
|
virtual bool HasBeenReferenced() { return mDefineState != BfTypeDefineState_Undefined; }
|
||||||
virtual bool HasTypeFailed() { return false; }
|
virtual bool HasTypeFailed() { return false; }
|
||||||
virtual bool IsDataIncomplete() { return mDefineState == BfTypeDefineState_Undefined; }
|
virtual bool IsDataIncomplete() { return mDefineState == BfTypeDefineState_Undefined; }
|
||||||
|
virtual bool IsFinishingType() { return false; }
|
||||||
virtual bool IsIncomplete() { return mDefineState < BfTypeDefineState_Defined; }
|
virtual bool IsIncomplete() { return mDefineState < BfTypeDefineState_Defined; }
|
||||||
virtual bool IsDeleting() { return ((mRebuildFlags & (BfTypeRebuildFlag_Deleted | BfTypeRebuildFlag_DeleteQueued)) != 0); }
|
virtual bool IsDeleting() { return ((mRebuildFlags & (BfTypeRebuildFlag_Deleted | BfTypeRebuildFlag_DeleteQueued)) != 0); }
|
||||||
virtual bool IsDeclared() { return mDefineState >= BfTypeDefineState_Declared; }
|
virtual bool IsDeclared() { return mDefineState >= BfTypeDefineState_Declared; }
|
||||||
|
@ -1954,6 +1955,7 @@ public:
|
||||||
virtual bool IsReified() override { return mIsReified; }
|
virtual bool IsReified() override { return mIsReified; }
|
||||||
virtual bool NeedsExplicitAlignment() override { return !IsSizeAligned() || mIsPacked; }
|
virtual bool NeedsExplicitAlignment() override { return !IsSizeAligned() || mIsPacked; }
|
||||||
virtual bool IsDataIncomplete() override { return ((mTypeIncomplete) || (mBaseTypeMayBeIncomplete)) && (!mNeedsMethodProcessing); }
|
virtual bool IsDataIncomplete() override { return ((mTypeIncomplete) || (mBaseTypeMayBeIncomplete)) && (!mNeedsMethodProcessing); }
|
||||||
|
virtual bool IsFinishingType() override { return mIsFinishingType; }
|
||||||
virtual bool IsIncomplete() override { return (mTypeIncomplete) || (mBaseTypeMayBeIncomplete); }
|
virtual bool IsIncomplete() override { return (mTypeIncomplete) || (mBaseTypeMayBeIncomplete); }
|
||||||
virtual bool IsSplattable() override { BF_ASSERT((mInstSize >= 0) || (!IsComposite())); return mIsSplattable; }
|
virtual bool IsSplattable() override { BF_ASSERT((mInstSize >= 0) || (!IsComposite())); return mIsSplattable; }
|
||||||
virtual int GetSplatCount() override;
|
virtual int GetSplatCount() override;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue