Skip to content

Commit

Permalink
Fixed union lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
bfiete committed Sep 5, 2022
1 parent 519ccfe commit d2356a0
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions IDEHelper/Compiler/BfExprEvaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit d2356a0

Please sign in to comment.