diff --git a/Install/Windows/glslangValidator.exe b/Install/Windows/glslangValidator.exe index ed4ec071..92ca9374 100644 Binary files a/Install/Windows/glslangValidator.exe and b/Install/Windows/glslangValidator.exe differ diff --git a/Test/switch.frag b/Test/switch.frag index 2cb6f21a..b6cef884 100644 --- a/Test/switch.frag +++ b/Test/switch.frag @@ -109,8 +109,13 @@ void main() break; } break; - default: + case 4: f = tan(x); + if (f < 0.0) + default: // ERROR + break; } + case 5: // ERROR + default: // ERROR } diff --git a/glslang/Include/revision.h b/glslang/Include/revision.h index 4157e02e..15a63d39 100644 --- a/glslang/Include/revision.h +++ b/glslang/Include/revision.h @@ -9,5 +9,5 @@ // source have to figure out how to create revision.h just to get a build // going. However, if it is not updated, it can be a version behind. -#define GLSLANG_REVISION "24627" -#define GLSLANG_DATE "2013/12/30 13:40:03" +#define GLSLANG_REVISION "24628" +#define GLSLANG_DATE "2013/12/30 13:44:49" diff --git a/glslang/MachineIndependent/glslang.y b/glslang/MachineIndependent/glslang.y index 7e4f6e7b..7aaecbe2 100644 --- a/glslang/MachineIndependent/glslang.y +++ b/glslang/MachineIndependent/glslang.y @@ -2276,16 +2276,25 @@ switch_statement_list case_label : CASE expression COLON { + $$ = 0; if (parseContext.switchLevel.size() == 0) parseContext.error($1.loc, "cannot appear outside switch statement", "case", ""); else if (parseContext.switchLevel.back() != parseContext.controlFlowNestingLevel) parseContext.error($1.loc, "cannot be nested inside control flow", "case", ""); - parseContext.constantValueCheck($2, "case"); - parseContext.integerCheck($2, "case"); - $$ = parseContext.intermediate.addBranch(EOpCase, $2, $1.loc); + else { + parseContext.constantValueCheck($2, "case"); + parseContext.integerCheck($2, "case"); + $$ = parseContext.intermediate.addBranch(EOpCase, $2, $1.loc); + } } | DEFAULT COLON { - $$ = parseContext.intermediate.addBranch(EOpDefault, $1.loc); + $$ = 0; + if (parseContext.switchLevel.size() == 0) + parseContext.error($1.loc, "cannot appear outside switch statement", "default", ""); + else if (parseContext.switchLevel.back() != parseContext.controlFlowNestingLevel) + parseContext.error($1.loc, "cannot be nested inside control flow", "default", ""); + else + $$ = parseContext.intermediate.addBranch(EOpDefault, $1.loc); } ;