1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +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())) if ((target.mType->IsUnion()) && (!target.mType->IsValuelessType()))
{ target = mModule->MakeAddressable(target);
auto ptrTarget = mModule->MakeAddressable(target);
BfIRType llvmPtrType = mModule->mBfIRBuilder->GetPointerTo(mModule->mBfIRBuilder->MapType(resolvedFieldType));
return BfTypedValue(mModule->mBfIRBuilder->CreateBitCast(ptrTarget.mValue, llvmPtrType), resolvedFieldType, true);
}
BfTypedValue retVal; BfTypedValue retVal;
if (target.IsSplat()) if (target.IsSplat())