glsl: propagate errors from *=, /=, +=, -= operators

Fixes compiler crash on:

void main()
{
    gl_FragColor = a += 1;
}

(a is not declared anywhere)

Found with AFL++.

Fixes: d1fa69ed61 ("glsl: do not attempt assignment if operand type not parsed correctly")
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12717>
This commit is contained in:
Marcin Ślusarz
2021-09-03 11:46:46 +02:00
committed by Marge Bot
parent 0edbdc671f
commit 26302ccdc1

View File

@@ -1703,6 +1703,7 @@ ast_expression::do_hir(exec_list *instructions,
if ((op[0]->type == glsl_type::error_type ||
op[1]->type == glsl_type::error_type)) {
error_emitted = true;
result = ir_rvalue::error_value(ctx);
break;
}