From 26302ccdc14f10265267f98aa79481ad88cd860c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20=C5=9Alusarz?= Date: Fri, 3 Sep 2021 11:46:46 +0200 Subject: [PATCH] glsl: propagate errors from *=, /=, +=, -= operators MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes compiler crash on: void main() { gl_FragColor = a += 1; } (a is not declared anywhere) Found with AFL++. Fixes: d1fa69ed61d ("glsl: do not attempt assignment if operand type not parsed correctly") Signed-off-by: Marcin Ślusarz Reviewed-by: Matt Turner Reviewed-by: Tapani Pälli Part-of: --- src/compiler/glsl/ast_to_hir.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp index 3a5c0a1b6a8..05c79faf668 100644 --- a/src/compiler/glsl/ast_to_hir.cpp +++ b/src/compiler/glsl/ast_to_hir.cpp @@ -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; }