mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-01 18:58:10 +02:00
nir/find_array_copies: Don't assume all children exist
Fixes: 9f3c595dfc "nir/find_array_copies: Handle cast derefs"
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7437>
This commit is contained in:
parent
e1736c7fdb
commit
58e7088628
1 changed files with 4 additions and 2 deletions
|
|
@ -196,8 +196,10 @@ _foreach_child(match_cb cb, struct match_node *node, struct match_state *state)
|
|||
if (node->num_children == 0) {
|
||||
cb(node, state);
|
||||
} else {
|
||||
for (unsigned i = 0; i < node->num_children; i++)
|
||||
_foreach_child(cb, node->children[i], state);
|
||||
for (unsigned i = 0; i < node->num_children; i++) {
|
||||
if (node->children[i])
|
||||
_foreach_child(cb, node->children[i], state);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue