Fix variable scoping of do-while

Fixes #2744
This commit is contained in:
Greg Fischer 2021-09-24 10:12:37 -06:00
parent fb0e4983e4
commit 994987bc90
3 changed files with 190 additions and 184 deletions

View file

@ -3926,6 +3926,7 @@ iteration_statement_nonattributed
--parseContext.controlFlowNestingLevel;
}
| DO {
parseContext.symbolTable.push();
++parseContext.loopNestingLevel;
++parseContext.statementNestingLevel;
++parseContext.controlFlowNestingLevel;
@ -3937,6 +3938,7 @@ iteration_statement_nonattributed
parseContext.boolCheck($8.loc, $6);
$$ = parseContext.intermediate.addLoop($3, $6, 0, false, $4.loc);
parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
--parseContext.loopNestingLevel;
--parseContext.statementNestingLevel;
--parseContext.controlFlowNestingLevel;