projects
/
platform
/
upstream
/
glslang.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9b5668c
)
HLSL: Protect against 'continue' outside of loops.
author
John Kessenich
<cepheus@frii.com>
Wed, 10 Jan 2018 10:50:42 +0000
(
03:50
-0700)
committer
John Kessenich
<cepheus@frii.com>
Wed, 10 Jan 2018 10:50:42 +0000
(
03:50
-0700)
hlsl/hlslGrammar.cpp
patch
|
blob
|
history
diff --git
a/hlsl/hlslGrammar.cpp
b/hlsl/hlslGrammar.cpp
index
2fd3933
..
60ea50e
100755
(executable)
--- a/
hlsl/hlslGrammar.cpp
+++ b/
hlsl/hlslGrammar.cpp
@@
-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);