freedreno/a4xx: silence coverity warning
authorRob Clark <robclark@freedesktop.org>
Thu, 2 Jun 2016 15:47:11 +0000 (11:47 -0400)
committerRob Clark <robclark@freedesktop.org>
Thu, 2 Jun 2016 19:44:07 +0000 (15:44 -0400)
CID 1362451

Signed-off-by: Rob Clark <robclark@freedesktop.org>
src/gallium/drivers/freedreno/a4xx/fd4_program.c

index 9dc4ebbf0867118824f3a74c5b6da73cece2bd82..4590c0e7df9e4b74b8a5ec739098b15986d4073c 100644 (file)
@@ -121,6 +121,12 @@ emit_shader(struct fd_ringbuffer *ring, const struct ir3_shader_variant *so)
                OUT_RELOC(ring, so->bo, 0,
                                CP_LOAD_STATE_1_STATE_TYPE(ST_SHADER), 0);
        }
+
+       /* for how clever coverity is, it is sometimes rather dull, and
+        * doesn't realize that the only case where bin==NULL, sz==0:
+        */
+       assume(bin || (sz == 0));
+
        for (i = 0; i < sz; i++) {
                OUT_RING(ring, bin[i]);
        }