[Mesa-dev] [PATCH (gles3) 08/20] glsl/ir_factory: Initialize members to NULL in constructor

Chad Versace chad.versace at linux.intel.com
Mon Jan 21 00:49:20 PST 2013


This eliminates unexpected behavior due to unitialized values.

Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
---
 src/glsl/ir_builder.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/glsl/ir_builder.h b/src/glsl/ir_builder.h
index 067858d..278294f 100644
--- a/src/glsl/ir_builder.h
+++ b/src/glsl/ir_builder.h
@@ -73,6 +73,13 @@ public:
 
 class ir_factory {
 public:
+   ir_factory()
+      : instructions(NULL),
+        mem_ctx(NULL)
+   {
+      return;
+   }
+
    void emit(ir_instruction *ir);
    ir_variable *make_temp(const glsl_type *type, const char *name);
 
-- 
1.8.1.1



More information about the mesa-dev mailing list