mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 03:28:20 +02:00
More protection for foreach failure
This commit is contained in:
parent
192c9d8f33
commit
ad3c7ce767
1 changed files with 10 additions and 1 deletions
|
@ -7192,6 +7192,11 @@ void BfModule::Visit(BfForEachStatement* forEachStmt)
|
||||||
|
|
||||||
mBfIRBuilder->CreateBr(endBB);
|
mBfIRBuilder->CreateBr(endBB);
|
||||||
}
|
}
|
||||||
|
else if (!getNextMethodInst)
|
||||||
|
{
|
||||||
|
AssertErrorState();
|
||||||
|
mBfIRBuilder->CreateBr(endBB);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BfExprEvaluator exprEvaluator(this);
|
BfExprEvaluator exprEvaluator(this);
|
||||||
|
@ -7315,7 +7320,11 @@ void BfModule::Visit(BfForEachStatement* forEachStmt)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (needsValCopy)
|
if (nextEmbeddedType->IsVar())
|
||||||
|
{
|
||||||
|
AssertErrorState();
|
||||||
|
}
|
||||||
|
else if (needsValCopy)
|
||||||
{
|
{
|
||||||
auto nextVal = BfTypedValue(mBfIRBuilder->CreateBitCast(nextResult.mValue, mBfIRBuilder->MapType(CreatePointerType(nextEmbeddedType))), nextEmbeddedType, true);
|
auto nextVal = BfTypedValue(mBfIRBuilder->CreateBitCast(nextResult.mValue, mBfIRBuilder->MapType(CreatePointerType(nextEmbeddedType))), nextEmbeddedType, true);
|
||||||
if (isRefExpression)
|
if (isRefExpression)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue