Commit 63400477 by John Kessenich

HLSL: Protect against 'continue' outside of loops.

parent 9b5668c8
...@@ -3786,6 +3786,10 @@ bool HlslGrammar::acceptJumpStatement(TIntermNode*& statement) ...@@ -3786,6 +3786,10 @@ bool HlslGrammar::acceptJumpStatement(TIntermNode*& statement)
switch (jump) { switch (jump) {
case EHTokContinue: case EHTokContinue:
statement = intermediate.addBranch(EOpContinue, token.loc); statement = intermediate.addBranch(EOpContinue, token.loc);
if (parseContext.loopNestingLevel == 0) {
expected("loop");
return false;
}
break; break;
case EHTokBreak: case EHTokBreak:
statement = intermediate.addBranch(EOpBreak, token.loc); statement = intermediate.addBranch(EOpBreak, token.loc);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment