1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-12 05:14:10 +02:00

Aggregate fix for nullable casting

This commit is contained in:
Brian Fiete 2025-03-22 17:01:18 -04:00
parent c7da3e15f9
commit 65a3bb2196

View file

@ -14087,6 +14087,7 @@ BfIRValue BfModule::CastToValue(BfAstNode* srcNode, BfTypedValue typedVal, BfTyp
if (!typedVal.IsAddr()) if (!typedVal.IsAddr())
{ {
auto srcAlloca = CreateAllocaInst(fromNullableType); auto srcAlloca = CreateAllocaInst(fromNullableType);
typedVal = LoadOrAggregateValue(typedVal);
mBfIRBuilder->CreateStore(typedVal.mValue, srcAlloca); mBfIRBuilder->CreateStore(typedVal.mValue, srcAlloca);
srcPtr = srcAlloca; srcPtr = srcAlloca;
} }