Mesa (master): i915: Fix use of uninitialized variable in OPCODE_NOISE stub .

Eric Anholt anholt at kemper.freedesktop.org
Tue Dec 22 14:21:04 PST 2009


Module: Mesa
Branch: master
Commit: e3202a8cc7178373e8e5af60c090550aef29392c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e3202a8cc7178373e8e5af60c090550aef29392c

Author: Eric Anholt <eric at anholt.net>
Date:   Tue Dec 22 11:08:38 2009 -0800

i915: Fix use of uninitialized variable in OPCODE_NOISE stub.

We don't actually care which register is used since we're just
swizzling (0,0,0,0), but it should be a valid variable number.
Detected by clang.

---

 src/mesa/drivers/dri/i915/i915_fragprog.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/i915/i915_fragprog.c b/src/mesa/drivers/dri/i915/i915_fragprog.c
index 9e4d318..a273bd2 100644
--- a/src/mesa/drivers/dri/i915/i915_fragprog.c
+++ b/src/mesa/drivers/dri/i915/i915_fragprog.c
@@ -663,7 +663,7 @@ upload_program(struct i915_fragment_program *p)
 			 A0_MOV,
 			 get_result_vector(p, inst),
 			 get_result_flags(inst), 0,
-			 swizzle(src0, ZERO, ZERO, ZERO, ZERO), 0, 0);
+			 swizzle(tmp, ZERO, ZERO, ZERO, ZERO), 0, 0);
 
       case OPCODE_POW:
          src0 = src_vector(p, &inst->SrcReg[0], program);



More information about the mesa-commit mailing list