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:
parent
519ccfe969
commit
d2356a0582
1 changed files with 1 additions and 5 deletions
|
@ -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())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue