From ae5770171ccfb085a57c3ef9251c16484c47b6af Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Sun, 12 Aug 2018 15:24:38 +0200 Subject: [PATCH] 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 Reviewed-by: Gert Wollny --- 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 a2083a4f856..2b9183abbb8 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); } } } -- 2.30.2