Mesa (master): i965: Prevent coverity warning

Eric Engeström eric_engestrom at kemper.freedesktop.org
Wed Feb 1 17:15:23 UTC 2017


Module: Mesa
Branch: master
Commit: 25f2d3c1d3328ed4e95547e89dddbe73c423fc9e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=25f2d3c1d3328ed4e95547e89dddbe73c423fc9e

Author: Robert Foss <robert.foss at collabora.com>
Date:   Wed Feb  1 11:24:39 2017 -0500

i965: Prevent coverity warning

Add assert checking that num_sources is never larger than 3.

This prevents Coverity from concluding that the unhandled
cases of num_sources not being 0-3 are relevant.

Coverity-Id: 1399480-1399489
Signed-off-by: Robert Foss <robert.foss at collabora.com>
Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral at igalia.com>

---

 src/mesa/drivers/dri/i965/brw_eu_validate.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/mesa/drivers/dri/i965/brw_eu_validate.c b/src/mesa/drivers/dri/i965/brw_eu_validate.c
index 2265394..64615af 100644
--- a/src/mesa/drivers/dri/i965/brw_eu_validate.c
+++ b/src/mesa/drivers/dri/i965/brw_eu_validate.c
@@ -177,6 +177,7 @@ num_sources_from_inst(const struct gen_device_info *devinfo,
          return 0;
       }
    } else {
+      assert(desc->nsrc < 4);
       return desc->nsrc;
    }
 




More information about the mesa-commit mailing list