diff options
author | Jason Ekstrand <[email protected]> | 2017-07-18 16:50:39 -0700 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2017-07-19 11:06:23 +1000 |
commit | ecf91898e0a8e144adb82d72aecf1224e77ee31b (patch) | |
tree | d95a77e2b86d8eb5de46f96d7dbefca733283ef1 /src | |
parent | d9015b1eab66afd8c53cbd35e6e946e041848727 (diff) |
nir/vars_to_ssa: Handle missing struct members in foreach_deref_node
This can happen if, for instance, you have an array of structs and there
are both direct and wildcard references to the same struct and some
members only have direct or only have indirect.
Reviewed-by: Timothy Arceri <[email protected]>
Cc: [email protected]
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/nir/nir_lower_vars_to_ssa.c | 8 |
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: |