Mesa (master): gallivm: Remove NULL check of pointer that can't be NULL.

Vinson Lee vlee at kemper.freedesktop.org
Sun Apr 25 06:34:39 UTC 2010


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

Author: Vinson Lee <vlee at vmware.com>
Date:   Sat Apr 24 23:31:35 2010 -0700

gallivm: Remove NULL check of pointer that can't be NULL.

info cannot be NULL at the call to debug_printf. emit_instruction
dereferences info, so at debug_printf it is either not NULL or the
program has already crashed.

---

 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 df2e24c..aed1d58 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
@@ -1812,7 +1812,7 @@ lp_build_tgsi_soa(LLVMBuilderRef builder,
             const struct tgsi_opcode_info *info = tgsi_get_opcode_info(opcode);
             if (!emit_instruction( &bld, &parse.FullToken.FullInstruction, info ))
                _debug_printf("warning: failed to translate tgsi opcode %s to LLVM\n",
-                             info ? info->mnemonic : "<invalid>");
+                             info->mnemonic);
          }
 
          break;




More information about the mesa-commit mailing list