mesa: glsl: added initializer size/type error checking
authorBrian Paul <brian.paul@tungstengraphics.com>
Mon, 4 Aug 2008 16:21:55 +0000 (10:21 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Mon, 4 Aug 2008 23:14:48 +0000 (17:14 -0600)
src/mesa/shader/slang/slang_codegen.c

index ad9cf06e2751a1242ca9ffcca4b74823b5b1ab13..92c96bef9ee0cc0ee932bc37e5e872644b466b72 100644 (file)
@@ -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 {