Skip to contentSkip to conversation

nv50: fix uninitialized variable in nv50_revdep_reorder

PATCH In review Marcin Slusarz 2 participants 2 messages Jan 24, 2010 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nv50: fix uninitialized variable in nv50_revdep_reorder

"unsafe" is never initialized, but used
(found by valgrind)

---
 src/gallium/drivers/nv50/nv50_program.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
src/gallium/drivers/nv50/nv50_program.c +1 -1
index cfe8b48..6d9ac14 100644
@@ -3275,7 +3275,7 @@ prep_inspect_insn(struct nv50_pc *pc, const struct tgsi_full_instruction *insn)
 static unsigned
 nv50_revdep_reorder(unsigned m[4], unsigned rdep[4])
 {
-	unsigned i, c, x, unsafe;
+	unsigned i, c, x, unsafe = 0;
 
 	for (c = 0; c < 4; c++)
 		m[c] = c;
Signature · 1 line
1.6.6
#2 lore raw
In reply to a message not in the archive
Quoted 2 lines · Marcin Slusarz

"unsafe" is never initialized, but used
(found by valgrind)

Pushed, plus the other three patches you pinged on.

Ben.

Quoted 17 lines
---
 src/gallium/drivers/nv50/nv50_program.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
src/gallium/drivers/nv50/nv50_program.c +1 -1
index cfe8b48..6d9ac14 100644
@@ -3275,7 +3275,7 @@ prep_inspect_insn(struct nv50_pc *pc, const struct tgsi_full_instruction *insn)
 static unsigned
 nv50_revdep_reorder(unsigned m[4], unsigned rdep[4])
 {
-	unsigned i, c, x, unsafe;
+	unsigned i, c, x, unsafe = 0;
 
 	for (c = 0; c < 4; c++)
 		m[c] = c;