Skip to content
Snippets Groups Projects
Commit 9b5668c8 authored by John Kessenich's avatar John Kessenich
Browse files

HLSL: Fix #1214: check for nesting in loop/switch of break statements.

parent 7420a761
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment