Mesa (master): mesa/st/glsl_to_tgsi: fixup copy-paste mistake

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Aug 13 16:17:08 UTC 2018


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

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Sun Aug 12 15:24:38 2018 +0200

mesa/st/glsl_to_tgsi: fixup copy-paste mistake

This is clearly a copy-paste error; if we validate the reladdr2-pointer,
we don't want to traverse to the reladdr-pointer. Especially since the
check above shows that reladdr could be NULL here.

Noticed by Coverity.

CID: 1438389, 1438390
Fixes: 568bda2f2d3 ("mesa/st/glsl_to_tgsi: Split arrays whose elements are only accessed directly")
Signed-off-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
Reviewed-by: Gert Wollny <gw.fossdev at gmail.com>

---

 src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index a2083a4f85..2b9183abbb 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -5493,7 +5493,7 @@ void test_indirect_access(const st_reg& reg, bool *has_indirect_access)
 	 if (reg.reladdr)
 	    test_indirect_access(*reg.reladdr, has_indirect_access);
 	 if (reg.reladdr2)
-	    test_indirect_access(*reg.reladdr, has_indirect_access);
+	    test_indirect_access(*reg.reladdr2, has_indirect_access);
       }
    }
 }




More information about the mesa-commit mailing list