1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +02:00

Make initializer expression work with 'in' ref values

This commit is contained in:
Brian Fiete 2024-09-12 07:40:52 -04:00
parent 91c0ec9239
commit b34a14502d
3 changed files with 8 additions and 5 deletions

View file

@ -11625,7 +11625,10 @@ void BfExprEvaluator::Visit(BfInitializerExpression* initExpr)
mModule->mBfIRBuilder->SetInsertPoint(initBlock);
}
BfTypedValue initValue = GetResult(true);
BfTypedValue origInitValue = GetResult(true);
BfTypedValue initValue = origInitValue;
if ((initValue) && (initValue.mType->IsRef()))
initValue = mModule->RemoveRef(initValue, false);
bool isFirstAdd = true;
for (auto elementExpr : initExpr->mValues)
@ -11749,7 +11752,7 @@ void BfExprEvaluator::Visit(BfInitializerExpression* initExpr)
mModule->mBfIRBuilder->SetInsertPoint(curBlock);
}
mResult = initValue;
mResult = origInitValue;
}
void BfExprEvaluator::Visit(BfCollectionInitializerExpression* arrayInitExpr)