1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-09 03:52:19 +02:00

Struct cast fix, deferred block fix

This commit is contained in:
Brian Fiete 2019-12-13 14:22:23 -08:00
parent 2fb4b14e50
commit 8b17718fed
8 changed files with 82 additions and 18 deletions

View file

@ -8079,6 +8079,11 @@ BfIRValue BfModule::CastToValue(BfAstNode* srcNode, BfTypedValue typedVal, BfTyp
{
if (toType->IsValuelessType())
return BfIRValue::sValueless;
if (ignoreWrites)
return mBfIRBuilder->GetFakeVal();
typedVal = MakeAddressable(typedVal);
return mBfIRBuilder->CreateBitCast(typedVal.mValue, mBfIRBuilder->MapTypeInstPtr(toTypeInstance));
}
}