1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 11:38:21 +02:00

Fixed union lookup

This commit is contained in:
Brian Fiete 2022-09-05 08:13:41 -07:00
parent 519ccfe969
commit d2356a0582

View file

@ -5320,11 +5320,7 @@ BfTypedValue BfExprEvaluator::LoadField(BfAstNode* targetSrc, BfTypedValue targe
}
if ((target.mType->IsUnion()) && (!target.mType->IsValuelessType()))
{
auto ptrTarget = mModule->MakeAddressable(target);
BfIRType llvmPtrType = mModule->mBfIRBuilder->GetPointerTo(mModule->mBfIRBuilder->MapType(resolvedFieldType));
return BfTypedValue(mModule->mBfIRBuilder->CreateBitCast(ptrTarget.mValue, llvmPtrType), resolvedFieldType, true);
}
target = mModule->MakeAddressable(target);
BfTypedValue retVal;
if (target.IsSplat())