summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTapani Pälli <tapani.palli@intel.com>2018-09-25 17:04:40 +0300
committerTapani Pälli <tapani.palli@intel.com>2018-10-08 08:02:50 +0300
commitd1fa69ed61d5aebeb69ce8a415c098035a953d48 (patch)
tree2198c6f773d795f5c39d6a92bce9c6188aa76f1f
parentd877451b48a59ab0f9a4210fc736f51da5851c9a (diff)
glsl: do not attempt assignment if operand type not parsed correctly
v2: check types of both operands (Ian) Cc: mesa-stable@lists.freedesktop.org Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108012
-rw-r--r--src/compiler/glsl/ast_to_hir.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index 93e7c8ec334..1082d6c91cf 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);