Mesa (master): glsl: stop processing function parameters if error happened

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Apr 13 13:11:01 UTC 2020


Module: Mesa
Branch: master
Commit: 53e4159eaaf692071bf63365eb27a16c97c9a3e5
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=53e4159eaaf692071bf63365eb27a16c97c9a3e5

Author: Tapani Pälli <tapani.palli at intel.com>
Date:   Fri Mar 27 09:04:31 2020 +0200

glsl: stop processing function parameters if error happened

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 at intel.com>
Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4341>

---

 src/compiler/glsl/ast_function.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/compiler/glsl/ast_function.cpp b/src/compiler/glsl/ast_function.cpp
index 5cbc713e6e1..08a200347af 100644
--- a/src/compiler/glsl/ast_function.cpp
+++ b/src/compiler/glsl/ast_function.cpp
@@ -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);
 



More information about the mesa-commit mailing list