fix failure caused by undeclared variable (bug 11783)

This commit is contained in:
Brian 2007-07-31 09:43:40 -06:00
parent aa5b748c10
commit e262d0182f

View file

@ -2056,7 +2056,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);