From: Robert Foss Date: Wed, 1 Feb 2017 16:24:39 +0000 (-0500) Subject: i965: Prevent coverity warning X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=25f2d3c1d3328ed4e95547e89dddbe73c423fc9e;p=mesa.git 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 Reviewed-by: Anuj Phogat Reviewed-by: Iago Toral Quiroga --- diff --git a/src/mesa/drivers/dri/i965/brw_eu_validate.c b/src/mesa/drivers/dri/i965/brw_eu_validate.c index 226539445d9..64615af44ac 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; }