glsl: do not attempt assignment if operand type not parsed correctly
authorTapani Pälli <tapani.palli@intel.com>
Tue, 25 Sep 2018 14:04:40 +0000 (17:04 +0300)
committerTapani Pälli <tapani.palli@intel.com>
Mon, 8 Oct 2018 05:02:50 +0000 (08:02 +0300)
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

src/compiler/glsl/ast_to_hir.cpp

index 93e7c8ec334836aac15933edda08701b7a1101ad..1082d6c91cf7f2732c4a9670aa70d7cd4dd0ae1c 100644 (file)
@@ -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);