From: Brian Paul Date: Mon, 4 Aug 2008 16:21:55 +0000 (-0600) Subject: mesa: glsl: added initializer size/type error checking X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e68a3ef1efc3873afb64acd15a0ea27a6ba54bda;p=mesa.git mesa: glsl: added initializer size/type error checking --- diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index ad9cf06e275..92c96bef9ee 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -2687,11 +2687,12 @@ _slang_gen_declaration(slang_assemble_ctx *A, slang_operation *oper) if (!rhs) return NULL; - assert(rhs); + if (!rhs->Store || var->Store->Size != rhs->Store->Size) { + slang_info_log_error(A->log, "invalid assignment (wrong types)"); + return NULL; + } + init = new_node2(IR_MOVE, var, rhs); - /* - assert(rhs->Opcode != IR_SEQ); - */ n = new_seq(varDecl, init); } else {