Mesa (master): glsl: do not attempt assignment if operand type not parsed correctly
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Oct 8 10:31:11 UTC 2018
Module: Mesa
Branch: master
Commit: d1fa69ed61d5aebeb69ce8a415c098035a953d48
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d1fa69ed61d5aebeb69ce8a415c098035a953d48
Author: Tapani Pälli <tapani.palli at intel.com>
Date: Tue Sep 25 17:04:40 2018 +0300
glsl: do not attempt assignment if operand type not parsed correctly
v2: check types of both operands (Ian)
Cc: mesa-stable at lists.freedesktop.org
Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108012
---
src/compiler/glsl/ast_to_hir.cpp | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index 93e7c8ec33..1082d6c91c 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -1685,6 +1685,12 @@ ast_expression::do_hir(exec_list *instructions,
op[1] = this->subexpressions[1]->hir(instructions, state);
orig_type = op[0]->type;
+
+ /* Break out if operand types were not parsed successfully. */
+ if ((op[0]->type == glsl_type::error_type ||
+ op[1]->type == glsl_type::error_type))
+ break;
+
type = arithmetic_result_type(op[0], op[1],
(this->oper == ast_mul_assign),
state, & loc);
More information about the mesa-commit
mailing list