HLSL: Protect against 'continue' outside of loops.
This commit is contained in:
parent
9b5668c8ef
commit
63400477f6
1 changed files with 4 additions and 0 deletions
|
|
@ -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);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue