[Mesa-dev] [PATCH] nir/validate: fix crash if entry is null.

Jason Ekstrand jason at jlekstrand.net
Mon May 20 03:59:37 UTC 2019


Seems fine. Rb

On May 19, 2019 20:11:50 Dave Airlie <airlied at gmail.com> wrote:

> From: Dave Airlie <airlied at redhat.com>
>
> we validate assert entry just before this, but since that doesn't
> stop execution, we need to check entry before the next validation
> assert.
> ---
> src/compiler/nir/nir_validate.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/compiler/nir/nir_validate.c b/src/compiler/nir/nir_validate.c
> index 8278176564f..b087b0da12d 100644
> --- a/src/compiler/nir/nir_validate.c
> +++ b/src/compiler/nir/nir_validate.c
> @@ -388,7 +388,7 @@ validate_var_use(nir_variable *var, validate_state *state)
> {
>    struct hash_entry *entry = _mesa_hash_table_search(state->var_defs, var);
>    validate_assert(state, entry);
> -   if (var->data.mode == nir_var_function_temp)
> +   if (entry && var->data.mode == nir_var_function_temp)
>       validate_assert(state, (nir_function_impl *) entry->data == state->impl);
> }
>
> --
> 2.21.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev





More information about the mesa-dev mailing list