OSDN Git Service

mesa/st/glsl_to_tgsi: fixup copy-paste mistake
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Sun, 12 Aug 2018 13:24:38 +0000 (15:24 +0200)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 13 Aug 2018 16:15:36 +0000 (18:15 +0200)
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: 14383891438390
Fixes: 568bda2f2d3 ("mesa/st/glsl_to_tgsi: Split arrays whose elements are only accessed directly")
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Gert Wollny <gw.fossdev@gmail.com>
src/mesa/state_tracker/st_glsl_to_tgsi.cpp

index a2083a4..2b9183a 100644 (file)
@@ -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);
       }
    }
 }