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

Labeled switch break fix

This commit is contained in:
Brian Fiete 2020-09-06 11:10:04 -07:00
parent 27e2ed1598
commit 4c69cb6f62

View file

@ -4084,8 +4084,6 @@ void BfModule::Visit(BfSwitchStatement* switchStmt)
outerScope.mCloseNode = switchStmt;
if (switchStmt->mCloseBrace != NULL)
outerScope.mCloseNode = switchStmt->mCloseBrace;
if (switchStmt->mLabelNode != NULL)
outerScope.mLabelNode = switchStmt->mLabelNode->mLabel;
mCurMethodState->AddScope(&outerScope);
NewScopeState();
@ -4129,6 +4127,8 @@ void BfModule::Visit(BfSwitchStatement* switchStmt)
newScope.mCloseNode = switchStmt;
if (switchStmt->mCloseBrace != NULL)
newScope.mCloseNode = switchStmt->mCloseBrace;
if (switchStmt->mLabelNode != NULL)
newScope.mLabelNode = switchStmt->mLabelNode->mLabel;
mCurMethodState->AddScope(&newScope);
NewScopeState();