glsl: stop processing function parameters if error happened
authorTapani Pälli <tapani.palli@intel.com>
Fri, 27 Mar 2020 07:04:31 +0000 (09:04 +0200)
committerTapani Pälli <tapani.palli@intel.com>
Mon, 13 Apr 2020 12:53:15 +0000 (15:53 +0300)
Fixes: d1fa69ed61d ("glsl: do not attempt assignment if operand type not parsed correctly")
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2696
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4341>

src/compiler/glsl/ast_function.cpp

index 5cbc713e6e13abcefc9350d9e77eda5ff5cffc8a..08a200347af947c7bed1cfeccae4431bffb0817a 100644 (file)
@@ -49,6 +49,10 @@ process_parameters(exec_list *instructions, exec_list *actual_parameters,
       ast->set_is_lhs(true);
       ir_rvalue *result = ast->hir(instructions, state);
 
+      /* Error happened, bail out. */
+      if (state->error)
+         return 0;
+
       ir_constant *const constant =
          result->constant_expression_value(mem_ctx);