aboutsummaryrefslogtreecommitdiffstats
path: root/src/glsl/ir.cpp
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2010-07-22 16:45:37 -0700
committerKenneth Graunke <[email protected]>2010-07-22 16:50:37 -0700
commit0a89175a35ba3ac2a94d0ba9bcc9926edc8927e3 (patch)
treea56971cac668b8cba2cc0aa61b2e74cd7eed6675 /src/glsl/ir.cpp
parent3c033637de7def553559c11d037f2e8bbb750f77 (diff)
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.
Diffstat (limited to 'src/glsl/ir.cpp')
-rw-r--r--src/glsl/ir.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/glsl/ir.cpp b/src/glsl/ir.cpp
index 5054ec725cc..8ebef7d95a3 100644
--- a/src/glsl/ir.cpp
+++ b/src/glsl/ir.cpp
@@ -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)
{