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:
parent
91c0ec9239
commit
b34a14502d
3 changed files with 8 additions and 5 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue