HLSL: Fix #1214: check for nesting in loop/switch of break statements.
This commit is contained in:
parent
7420a761a3
commit
9b5668c8ef
1 changed files with 4 additions and 0 deletions
|
|
@ -3789,6 +3789,10 @@ bool HlslGrammar::acceptJumpStatement(TIntermNode*& statement)
|
|||
break;
|
||||
case EHTokBreak:
|
||||
statement = intermediate.addBranch(EOpBreak, token.loc);
|
||||
if (parseContext.loopNestingLevel == 0 && parseContext.switchSequenceStack.size() == 0) {
|
||||
expected("loop or switch");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case EHTokDiscard:
|
||||
statement = intermediate.addBranch(EOpKill, token.loc);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue