Make switch statements have their own nested scope (bug 11904).
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@25949 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
parent
c63759ef01
commit
71e01cbab9
4 changed files with 99 additions and 1 deletions
|
|
@ -2255,14 +2255,18 @@ condition
|
|||
switch_statement
|
||||
: SWITCH LEFT_PAREN expression RIGHT_PAREN {
|
||||
// start new switch sequence on the switch stack
|
||||
++parseContext.controlFlowNestingLevel;
|
||||
parseContext.switchSequenceStack.push_back(new TIntermSequence);
|
||||
parseContext.switchLevel.push_back(parseContext.controlFlowNestingLevel);
|
||||
parseContext.symbolTable.push();
|
||||
}
|
||||
LEFT_BRACE switch_statement_list RIGHT_BRACE {
|
||||
$$ = parseContext.addSwitch($1.loc, $3, $7 ? $7->getAsAggregate() : 0);
|
||||
delete parseContext.switchSequenceStack.back();
|
||||
parseContext.switchSequenceStack.pop_back();
|
||||
parseContext.switchLevel.pop_back();
|
||||
parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
|
||||
--parseContext.controlFlowNestingLevel;
|
||||
}
|
||||
;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue