diff --git a/.pick_status.json b/.pick_status.json index 9205e3927a9..57773eab751 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -4711,7 +4711,7 @@ "description": "nir: Handle incomplete derefs in split_struct_vars", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": "f1cb3348f18a9b679925ee537091e52749e9f6da" }, diff --git a/src/compiler/nir/nir_split_vars.c b/src/compiler/nir/nir_split_vars.c index 6aee3109d41..3a4513077e9 100644 --- a/src/compiler/nir/nir_split_vars.c +++ b/src/compiler/nir/nir_split_vars.c @@ -232,6 +232,14 @@ split_struct_derefs_impl(nir_function_impl *impl, continue; nir_variable *base_var = nir_deref_instr_get_variable(deref); + /* If we can't chase back to the variable, then we're a complex use. + * This should have been detected by get_complex_used_vars() and the + * variable should not have been split. However, we have no way of + * knowing that here, so we just have to trust it. + */ + if (base_var == NULL) + continue; + struct hash_entry *entry = _mesa_hash_table_search(var_field_map, base_var); if (!entry)