1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-16 15:24:10 +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

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