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

Fixed foreach labeled break

This commit is contained in:
Brian Fiete 2021-05-31 07:30:33 -07:00
parent 85462e6d62
commit b204dbf8c0

View file

@ -5901,9 +5901,7 @@ void BfModule::Visit(BfForEachStatement* forEachStmt)
UpdateSrcPos(forEachStmt);
BfScopeData scopeData;
// We set mIsLoop after the non-looped initializations
if (forEachStmt->mLabelNode != NULL)
scopeData.mLabelNode = forEachStmt->mLabelNode->mLabel;
// We set mIsLoop after the non-looped initializations
scopeData.mValueScopeStart = ValueScopeStart();
mCurMethodState->AddScope(&scopeData);
NewScopeState();
@ -6425,6 +6423,8 @@ void BfModule::Visit(BfForEachStatement* forEachStmt)
}
BfScopeData innerScopeData;
if (forEachStmt->mLabelNode != NULL)
innerScopeData.mLabelNode = forEachStmt->mLabelNode->mLabel;
innerScopeData.mValueScopeStart = ValueScopeStart();
mCurMethodState->AddScope(&innerScopeData);
NewScopeState(true, false);