From e68a3ef1efc3873afb64acd15a0ea27a6ba54bda Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 4 Aug 2008 10:21:55 -0600 Subject: mesa: glsl: added initializer size/type error checking --- src/mesa/shader/slang/slang_codegen.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/mesa/shader') 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 { -- cgit v1.2.3