glsl/ast: Stop processing a switch-statement after an error in the init-expression
[mesa.git] / src / compiler / glsl / ast_to_hir.cpp
index 1999e68158cb6f0347a3be067e40364499dca3e3..4323ec32264ce3836dca707f46f9116b144989bb 100644 (file)
@@ -6407,6 +6407,7 @@ ast_switch_statement::hir(exec_list *instructions,
                        state,
                        "switch-statement expression must be scalar "
                        "integer");
+      return NULL;
    }
 
    /* Track the switch-statement nesting in a stack-like manner.