From 6b2b150a66fbf648521c5dcc6ad9cbb76c55e511 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 20 May 2019 11:05:15 +1000 Subject: [PATCH] nir/validate: fix crash if entry is null. we validate assert entry just before this, but since that doesn't stop execution, we need to check entry before the next validation assert. Reviewed-by: Jason Ekstrand --- 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 8278176..b087b0d 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.7.4