On 02/11/2013 10:46 PM, Vinson Lee wrote:
Fixes uninitialized pointer field defect reported by Coverity.

Signed-off-by: Vinson Lee <[email protected]>
---
  src/glsl/ir.h | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index efd80da..1e09988 100644
--- a/src/glsl/ir.h
+++ b/src/glsl/ir.h
@@ -1448,8 +1448,8 @@ enum ir_texture_opcode {
  class ir_texture : public ir_rvalue {
  public:
     ir_texture(enum ir_texture_opcode op)
-      : op(op), coordinate(NULL), projector(NULL), shadow_comparitor(NULL),
-        offset(NULL)
+      : op(op), sampler(NULL), coordinate(NULL), projector(NULL),
+        shadow_comparitor(NULL), offset(NULL)
     {
        this->ir_type = ir_type_texture;
     }

I think every user of this calls the set_sampler() method, which initalizes it. (Otherwise it'd be pretty catastrophically broken.)

But initializing it to NULL is a good safe practice, so:

Reviewed-by: Kenneth Graunke <[email protected]>

Thanks Vinson.
_______________________________________________
mesa-dev mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to