r600g/sb: Move variable dereference after null check.
authorVinson Lee <vlee@freedesktop.org>
Sat, 28 Sep 2013 06:05:54 +0000 (23:05 -0700)
committerVinson Lee <vlee@freedesktop.org>
Mon, 30 Sep 2013 17:27:52 +0000 (10:27 -0700)
Fixes "Deference before null check" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Vadim Girlin <vadimgirlin@gmail.com>
src/gallium/drivers/r600/sb/sb_ra_init.cpp

index 0b332a9847aba7445d53022c0c5eb9233394e428..e53aba540de13de92f59068a261085caf75177df 100644 (file)
@@ -395,11 +395,12 @@ void ra_init::color_bs_constraint(ra_constraint* c) {
 
        for (vvec::iterator I = vv.begin(), E = vv.end(); I != E; ++I) {
                value *v = *I;
-               sel_chan gpr = v->get_final_gpr();
 
                if (!v || v->is_dead())
                        continue;
 
+               sel_chan gpr = v->get_final_gpr();
+
                val_set interf;
 
                if (v->chunk)