1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +02:00

Fixed field dtors with valueless fields

This commit is contained in:
Brian Fiete 2021-02-15 07:18:58 -08:00
parent ce96772054
commit 0bbb8398d2

View file

@ -15743,7 +15743,11 @@ void BfModule::EmitDtorBody()
} }
else else
{ {
if (!mCurTypeInstance->IsValueType()) if (fieldInst->mResolvedType->IsValuelessType())
{
value = mBfIRBuilder->GetFakeVal();
}
else if (!mCurTypeInstance->IsValueType())
{ {
auto thisValue = GetThis(); auto thisValue = GetThis();
value = mBfIRBuilder->CreateInBoundsGEP(thisValue.mValue, 0, fieldInst->mDataIdx); value = mBfIRBuilder->CreateInBoundsGEP(thisValue.mValue, 0, fieldInst->mDataIdx);