Mesa (master): gallivm: fix warning: ‘value’ may be used uninitialized in this function

Marek Olšák mareko at kemper.freedesktop.org
Wed Apr 27 04:17:53 PDT 2011


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

Author: Marek Olšák <maraeo at gmail.com>
Date:   Wed Apr 27 13:05:53 2011 +0200

gallivm: fix warning: ‘value’ may be used uninitialized in this function

The path where it's uninitialized is guarded by an assert.

---

 src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
index d1585c8..d8adb9f 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
@@ -2565,7 +2565,7 @@ lp_build_system_values_array(struct gallivm_state *gallivm,
 
    for (i = 0; i < info->num_system_values; i++) {
       LLVMValueRef index = lp_build_const_int32(gallivm, i * 4);
-      LLVMValueRef ptr, value;
+      LLVMValueRef ptr, value = 0;
 
       switch (info->system_value_semantic_name[i]) {
       case TGSI_SEMANTIC_INSTANCEID:



More information about the mesa-commit mailing list