Mesa (7.11): prog_optimize: fix a warning that a variable may be uninitialized

Brian Paul brianp at kemper.freedesktop.org
Wed Jul 20 14:02:51 UTC 2011


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

Author: Marek Olšák <maraeo at gmail.com>
Date:   Fri Jul 15 20:57:39 2011 +0200

prog_optimize: fix a warning that a variable may be uninitialized

(cherry picked from commit dade65505bdf62da448479e316cc7f4f2da22417)
Signed-off-by: Brian Paul <brianp at vmware.com>

---

 src/mesa/program/prog_optimize.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/mesa/program/prog_optimize.c b/src/mesa/program/prog_optimize.c
index 11debc4..8a40fa6 100644
--- a/src/mesa/program/prog_optimize.c
+++ b/src/mesa/program/prog_optimize.c
@@ -1304,6 +1304,9 @@ _mesa_simplify_cmp(struct gl_program * program)
          assert(inst->DstReg.Index < REG_ALLOCATE_MAX_PROGRAM_TEMPS);
          prevWriteMask = tempWrites[inst->DstReg.Index];
          tempWrites[inst->DstReg.Index] |= inst->DstReg.WriteMask;
+      } else {
+         /* No other register type can be a destination register. */
+         continue;
       }
 
       /* For a CMP to be considered a conditional write, the destination




More information about the mesa-commit mailing list