[Mesa-dev] [PATCH v2] i965: Prevent coverity warning
Anuj Phogat
anuj.phogat at gmail.com
Tue Jan 31 18:26:55 UTC 2017
On Tue, Jan 31, 2017 at 6:46 AM, Robert Foss <robert.foss at collabora.com> wrote:
> Add assert checking that num_sources is never larger than 3.
>
> This prevents Coverity from concluding that the improperly handled
> cases of num_sources not being 0-3 are relevant.
>
You may change "improperly handled" to "unhandled".
> Coverity-Id: 1399480-1399489
> Signed-off-by: Robert Foss <robert.foss at collabora.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 226539445d..64615af44a 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;
> }
>
> --
> 2.11.0.453.g787f75f05
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>
More information about the mesa-dev
mailing list