HLSL: Protect against 'continue' outside of loops.

This commit is contained in:
John Kessenich 2018-01-10 03:50:42 -07:00
parent 9b5668c8ef
commit 63400477f6

View File

@ -3786,6 +3786,10 @@ bool HlslGrammar::acceptJumpStatement(TIntermNode*& statement)
switch (jump) {
case EHTokContinue:
statement = intermediate.addBranch(EOpContinue, token.loc);
if (parseContext.loopNestingLevel == 0) {
expected("loop");
return false;
}
break;
case EHTokBreak:
statement = intermediate.addBranch(EOpBreak, token.loc);