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:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user