nir/i965: assert first is always less than 64
authorJuan A. Suarez Romero <jasuarez@igalia.com>
Thu, 12 Jan 2017 09:31:34 +0000 (10:31 +0100)
committerJuan A. Suarez Romero <jasuarez@igalia.com>
Thu, 12 Jan 2017 15:08:05 +0000 (15:08 +0000)
This fixes a defect detected by Coverity Scan.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
src/mesa/drivers/dri/i965/brw_draw_upload.c

index a865f2793d16a5c1a0c40d77b92c46ca13e7d1d5..04d7aa9e9bf44e4bf47849d55ae8a98fd17c698a 100644 (file)
@@ -566,6 +566,7 @@ brw_prepare_vertices(struct brw_context *brw)
    brw->vb.nr_enabled = 0;
    while (vs_inputs) {
       GLuint first = ffsll(vs_inputs) - 1;
+      assert (first < 64);
       GLuint index =
          first - DIV_ROUND_UP(_mesa_bitcount_64(vs_prog_data->double_inputs_read &
                                                 BITFIELD64_MASK(first)), 2);