[Mesa-dev] [RFC 6/7] nir/validate: fix null deref coverity warning

Jason Ekstrand jason at jlekstrand.net
Mon May 23 01:40:39 UTC 2016


R-B

On Wed, May 18, 2016 at 8:54 AM, Rob Clark <robdclark at gmail.com> wrote:

> From: Rob Clark <robclark at freedesktop.org>
>
> CID 1265536 (#1 of 2): Explicit null dereferenced (FORWARD_NULL)6.
> var_deref_op: Dereferencing null pointer parent.
> ---
>  src/compiler/nir/nir_validate.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/src/compiler/nir/nir_validate.c
> b/src/compiler/nir/nir_validate.c
> index b186fd5..fa51e3c 100644
> --- a/src/compiler/nir/nir_validate.c
> +++ b/src/compiler/nir/nir_validate.c
> @@ -376,6 +376,7 @@ validate_deref_chain(nir_deref *deref, validate_state
> *state)
>           break;
>
>        case nir_deref_type_struct:
> +         assume(parent); /* cannot happen: deref change starts w/
> nir_deref_var */
>           validate_assert(state, deref->type ==
>                  glsl_get_struct_field(parent->type,
>                                        nir_deref_as_struct(deref)->index));
> --
> 2.5.5
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160522/da6e5767/attachment-0001.html>


More information about the mesa-dev mailing list