Mesa (master): tgsi: avoid returning pointer to local var, make it static

Ilia Mirkin imirkin at kemper.freedesktop.org
Sat Feb 21 22:32:03 UTC 2015


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

Author: Ilia Mirkin <imirkin at alum.mit.edu>
Date:   Sat Feb 21 12:44:05 2015 -0500

tgsi: avoid returning pointer to local var, make it static

Spotted by Coverity.

Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
Reviewed-by: Matt Turner <mattst88 at gmail.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>

---

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

diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c
index a8fc008..8d08059 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_exec.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c
@@ -1515,7 +1515,7 @@ store_dest_dstret(struct tgsi_exec_machine *mach,
                  enum tgsi_exec_datatype dst_datatype)
 {
    uint i;
-   union tgsi_exec_channel null;
+   static union tgsi_exec_channel null;
    union tgsi_exec_channel *dst;
    union tgsi_exec_channel index2D;
    uint execmask = mach->ExecMask;




More information about the mesa-commit mailing list