Track the flow-control (and {}) nesting level to prevent case statements from being a different nesting level than their switch statement.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24355 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich
2013-12-04 21:48:20 +00:00
parent 3a53006e0e
commit 7fd9e1189b
6 changed files with 140 additions and 8 deletions

View File

@@ -87,4 +87,30 @@ void main()
}
break; // ERROR
switch (c) {
case 1:
f = sin(x);
break;
case 2:
switch (d) {
case 1:
{
case 4: // ERROR
break;
}
f = x * x * x;
if (c < d) {
case 2: // ERROR
f = x * x;
}
if (d < c)
case 3: // ERROR
break;
}
break;
default:
f = tan(x);
}
}