fix failure caused by undeclared variable (bug 11783)
authorBrian <brian.paul@tungstengraphics.com>
Tue, 31 Jul 2007 15:43:57 +0000 (09:43 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Tue, 31 Jul 2007 15:43:57 +0000 (09:43 -0600)
src/mesa/shader/slang/slang_codegen.c

index 24185cf677029db544ea0fa0b667e77f9f750b50..d368009ca50a020fa399d469323774f814271623 100644 (file)
@@ -2059,7 +2059,8 @@ _slang_gen_declaration(slang_assemble_ctx *A, slang_operation *oper)
       }
       /* XXX make copy of this initializer? */
       rhs = _slang_gen_operation(A, &oper->children[0]);
-      assert(rhs);
+      if (!rhs)
+         return NULL;  /* must have found an error */
       init = new_node2(IR_MOVE, var, rhs);
       /*assert(rhs->Opcode != IR_SEQ);*/
       n = new_seq(varDecl, init);