diff options
author | Jason Ekstrand <jason@jlekstrand.net> | 2019-08-30 13:21:00 -0500 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2019-09-09 09:13:23 -0700 |
commit | 8889cc12412890d1989c71787be666f27c0b5337 (patch) | |
tree | 054f749a6415c4433b60e7ca0413f7014a33316f | |
parent | 89776bb48c340e43ce39fa9e755c3917c5213ef3 (diff) |
nir: Handle complex derefs in nir_split_array_vars
We already bail and don't split the vars but we were passing a NULL to
_mesa_hash_table_search which is not allowed.
Fixes: f1cb3348f1 "nir/split_vars: Properly bail in the presence of ..."
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
(cherry picked from commit 37cdb7fc4465cba67b220f940404338f6ff98ee1)
-rw-r--r-- | src/compiler/nir/nir_split_vars.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/compiler/nir/nir_split_vars.c b/src/compiler/nir/nir_split_vars.c index 3d98b5c8805..80536ac543a 100644 --- a/src/compiler/nir/nir_split_vars.c +++ b/src/compiler/nir/nir_split_vars.c @@ -427,8 +427,11 @@ get_array_deref_info(nir_deref_instr *deref, if (!(deref->mode & modes)) return NULL; - return get_array_var_info(nir_deref_instr_get_variable(deref), - var_info_map); + nir_variable *var = nir_deref_instr_get_variable(deref); + if (var == NULL) + return NULL; + + return get_array_var_info(var, var_info_map); } static void |