summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/compiler/nir/nir_lower_vars_to_ssa.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/compiler/nir/nir_lower_vars_to_ssa.c b/src/compiler/nir/nir_lower_vars_to_ssa.c
index e5a12eb9713..e8cfe308d26 100644
--- a/src/compiler/nir/nir_lower_vars_to_ssa.c
+++ b/src/compiler/nir/nir_lower_vars_to_ssa.c
@@ -245,8 +245,12 @@ foreach_deref_node_worker(struct deref_node *node, nir_deref *deref,
case nir_deref_type_struct: {
nir_deref_struct *str = nir_deref_as_struct(deref->child);
- return foreach_deref_node_worker(node->children[str->index],
- deref->child, cb, state);
+ if (node->children[str->index] &&
+ !foreach_deref_node_worker(node->children[str->index],
+ deref->child, cb, state))
+ return false;
+
+ return true;
}
default: