Mesa (master): llvmpipe: Fix another uninitialized value warning, on init_val.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Feb 19 00:13:35 UTC 2020


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

Author: Eric Anholt <eric at anholt.net>
Date:   Tue Jan 28 13:04:10 2020 -0800

llvmpipe: Fix another uninitialized value warning, on init_val.

It's only used in the vote_ieq paths, but gcc doesn't see that.

Reviewed-by: Roland Scheidegger <sroland at vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3867>

---

 src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c
index 67b7b69e8f4..a045e3712df 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c
@@ -1413,7 +1413,7 @@ static void emit_vote(struct lp_build_nir_context *bld_base, LLVMValueRef src, n
    LLVMValueRef outer_cond = LLVMBuildICmp(builder, LLVMIntNE, exec_mask, bld_base->uint_bld.zero, "");
 
    LLVMValueRef res_store = lp_build_alloca(gallivm, bld_base->int_bld.elem_type, "");
-   LLVMValueRef init_val;
+   LLVMValueRef init_val = NULL;
    if (instr->intrinsic == nir_intrinsic_vote_ieq) {
       /* for equal we unfortunately have to loop and find the first valid one. */
       lp_build_loop_begin(&loop_state, gallivm, lp_build_const_int32(gallivm, 0));



More information about the mesa-commit mailing list