[Mesa-dev] [PATCH v2 3/3] nv30: Fix "array subscript is below array bounds" compiler warning

Ilia Mirkin imirkin at alum.mit.edu
Wed Jun 29 13:30:48 UTC 2016


Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>

On Wed, Jun 29, 2016 at 8:38 AM, Hans de Goede <hdegoede at redhat.com> wrote:
> gcc6 does not like the trick where we point to one entry before the
> array start and then start a while with a pre-increment.
>
> Signed-off-by: Hans de Goede <hdegoede at redhat.com>
> ---
>  src/gallium/drivers/nouveau/nv30/nv30_transfer.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/src/gallium/drivers/nouveau/nv30/nv30_transfer.c b/src/gallium/drivers/nouveau/nv30/nv30_transfer.c
> index 9ecbcd1..5299b70 100644
> --- a/src/gallium/drivers/nouveau/nv30/nv30_transfer.c
> +++ b/src/gallium/drivers/nouveau/nv30/nv30_transfer.c
> @@ -663,8 +663,7 @@ nv30_transfer_rect(struct nv30_context *nv30, enum nv30_transfer_filter filter,
>        {}
>     };
>
> -   method = methods - 1;
> -   while ((++method)->possible) {
> +   for (method = methods; method->possible; method++) {
>        if (method->possible(nv30, filter, src, dst)) {
>           method->execute(nv30, filter, src, dst);
>           return;
> --
> 2.7.4
>


More information about the mesa-dev mailing list