glsl2: Initialize ir_instruction::type and ir_rvalue::type.

Top-level instructions now get NULL as their default type (since type is
irrelevant for things like ir_function), while ir_rvalues get error_type
by default.

This should make it easier to tell if we've forgotten to set a type.  It
also fixes some "Conditional jump or move depends on uninitialized
value" errors in valgrind caused by ir_validate examining the type of
top level ir_instructions, which weren't set.
This commit is contained in:
Kenneth Graunke
2010-07-22 16:45:37 -07:00
parent 3c033637de
commit 0a89175a35
2 changed files with 7 additions and 4 deletions

View File

@@ -26,6 +26,11 @@
#include "ir_visitor.h"
#include "glsl_types.h"
ir_rvalue::ir_rvalue()
{
this->type = glsl_type::error_type;
}
ir_assignment::ir_assignment(ir_rvalue *lhs, ir_rvalue *rhs,
ir_rvalue *condition)
{