Skip to content

Commit a8439ab

Browse files
committed
Refactored checkLabelList
1 parent bb3e172 commit a8439ab

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/Parser/Parse.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10510,7 +10510,7 @@ ParseNodePtr Parser::ParseStatement()
1051010510
{
1051110511
this->GetScanner()->Scan();
1051210512
// Check if label is found within the current label id list.
10513-
auto checkLabelList = [&](LabelId* list, OpCode checkOp)
10513+
auto checkLabelList = [&](LabelId* list, StmtNest* checkStmtOp)
1051410514
{
1051510515
for (LabelId* pLabelId = list; pLabelId; pLabelId = pLabelId->next)
1051610516
{
@@ -10520,7 +10520,7 @@ ParseNodePtr Parser::ParseStatement()
1052010520
// break out of any statement, but we can only
1052110521
// continue loops.
1052210522
if (fnop == fnopContinue &&
10523-
!(ParseNode::Grfnop(checkOp) & fnop))
10523+
!(ParseNode::Grfnop(checkStmtOp->op) & fnop))
1052410524
{
1052510525
Error(ERRbadContinue);
1052610526
}
@@ -10530,11 +10530,11 @@ ParseNodePtr Parser::ParseStatement()
1053010530
return false;
1053110531
};
1053210532

10533-
if (checkLabelList(pLabelIdList, m_pstmtCur->op)) goto LNeedTerminator;
10533+
if (checkLabelList(pLabelIdList, m_pstmtCur)) goto LNeedTerminator;
1053410534

1053510535
for (pstmt = m_pstmtCur; pstmt; pstmt = pstmt->pstmtOuter)
1053610536
{
10537-
if (checkLabelList(pstmt->pLabelId, pstmt->op)) goto LNeedTerminator;
10537+
if (checkLabelList(pstmt->pLabelId, pstmt)) goto LNeedTerminator;
1053810538
}
1053910539
}
1054010540
Error(ERRnoLabel);

0 commit comments

Comments
 (0)