Mesa (master): nir/i965: assert first is always less than 64
Juan Antonio Suárez Romero
jasuarez at kemper.freedesktop.org
Thu Jan 12 15:10:07 UTC 2017
Module: Mesa
Branch: master
Commit: ce44501ea87ff66267c9cf280e4596065ffebd46
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ce44501ea87ff66267c9cf280e4596065ffebd46
Author: Juan A. Suarez Romero <jasuarez at igalia.com>
Date: Thu Jan 12 10:31:34 2017 +0100
nir/i965: assert first is always less than 64
This fixes a defect detected by Coverity Scan.
Reviewed-by: Iago Toral Quiroga <itoral at igalia.com>
---
src/mesa/drivers/dri/i965/brw_draw_upload.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c
index a865f27..04d7aa9 100644
--- a/src/mesa/drivers/dri/i965/brw_draw_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c
@@ -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);
More information about the mesa-commit
mailing list