Signed-off-by: Tapani Pälli <tapani.pa...@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79724 --- src/glsl/ast_to_hir.cpp | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index d1c77f1..131b25f 100644 --- a/src/glsl/ast_to_hir.cpp +++ b/src/glsl/ast_to_hir.cpp @@ -4629,6 +4629,15 @@ ast_case_label::hir(exec_list *instructions, } } + /* Check that types match (no implicit conversions allowed). */ + if (label_const->type != state->switch_state.test_var->type) { + YYLTYPE loc = this->test_value->get_location(); + _mesa_glsl_error(&loc, state, + "type mismatch with switch init-expression and case " + "label (%s != %s)", label_const->type->name, + state->switch_state.test_var->type->name); + } + ir_dereference_variable *deref_test_var = new(ctx) ir_dereference_variable(state->switch_state.test_var); -- 1.8.3.1 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev