Mesa (staging/20.0): glsl: stop processing function parameters if error happened
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Apr 13 17:27:33 UTC 2020
Module: Mesa
Branch: staging/20.0
Commit: 8d1baa28546cad4009472a0c8fa4daaf2ef30139
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=8d1baa28546cad4009472a0c8fa4daaf2ef30139
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>
(cherry picked from commit 53e4159eaaf692071bf63365eb27a16c97c9a3e5)
---
.pick_status.json | 2 +-
src/compiler/glsl/ast_function.cpp | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/.pick_status.json b/.pick_status.json
index 9326ca1055f..bbc399b9bcd 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -31,7 +31,7 @@
"description": "glsl: stop processing function parameters if error happened",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"master_sha": null,
"because_sha": "d1fa69ed61d5aebeb69ce8a415c098035a953d48"
},
diff --git a/src/compiler/glsl/ast_function.cpp b/src/compiler/glsl/ast_function.cpp
index 4fd9b879555..590fe15aacd 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