mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 19:40:10 +01:00
glsl: set error_emitted true if type not ok for assignment
Patch changes also existing assert to not trigger when we have
error types in assignment.
v2: simplify, cleanup (Ian)
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2629
Fixes: d1fa69ed61 ("glsl: do not attempt assignment if operand type not parsed correctly")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4178>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4178>
This commit is contained in:
parent
05069e1f07
commit
0847fe6e7f
1 changed files with 5 additions and 2 deletions
|
|
@ -1689,8 +1689,11 @@ ast_expression::do_hir(exec_list *instructions,
|
|||
|
||||
/* Break out if operand types were not parsed successfully. */
|
||||
if ((op[0]->type == glsl_type::error_type ||
|
||||
op[1]->type == glsl_type::error_type))
|
||||
op[1]->type == glsl_type::error_type)) {
|
||||
type = glsl_type::error_type;
|
||||
error_emitted = true;
|
||||
break;
|
||||
}
|
||||
|
||||
type = arithmetic_result_type(op[0], op[1],
|
||||
(this->oper == ast_mul_assign),
|
||||
|
|
@ -2131,7 +2134,7 @@ ast_expression::do_hir(exec_list *instructions,
|
|||
}
|
||||
}
|
||||
type = NULL; /* use result->type, not type. */
|
||||
assert(result != NULL || !needs_rvalue);
|
||||
assert(error_emitted || (result != NULL || !needs_rvalue));
|
||||
|
||||
if (result && result->type->is_error() && !error_emitted)
|
||||
_mesa_glsl_error(& loc, state, "type mismatch");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue