1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +02:00

Splat fixes

This commit is contained in:
Brian Fiete 2022-07-30 08:07:12 -04:00
parent 56af3bb376
commit ab4719422a
2 changed files with 5 additions and 1 deletions

View file

@ -18124,6 +18124,8 @@ void BfModule::EmitCtorBody(bool& skipBody)
{
auto thisVal = GetThis();
auto fieldPtr = mBfIRBuilder->CreateInBoundsGEP(thisVal.mValue, 0, fieldInstance.mDataIdx);
if (mCurTypeInstance->IsUnion())
fieldPtr = mBfIRBuilder->CreateBitCast(fieldPtr, mBfIRBuilder->GetPointerTo(mBfIRBuilder->MapType(fieldInstance.mResolvedType)));
mBfIRBuilder->CreateAlignedStore(localVal.mValue, fieldPtr, localVar->mResolvedType->mAlign);
}
MarkFieldInitialized(&fieldInstance);