nir/find_array_copies: Use correct parent array length
authorConnor Abbott <cwabbott0@gmail.com>
Tue, 30 Jul 2019 09:05:22 +0000 (11:05 +0200)
committerConnor Abbott <cwabbott0@gmail.com>
Tue, 30 Jul 2019 15:14:33 +0000 (17:14 +0200)
commita094928abcbab7f7e1d81704b616605a4521dc1a
tree5f18c0609d860b82e384fa2d40b4933b2ef92f2b
parent7788992bc6864a072c824e16b666acad1e0786c8
nir/find_array_copies: Use correct parent array length

instr->type is the type of the array element, not the type of the array
being dereferenced. Rather than fishing out the parent type, just use
parent->num_children which should be the length plus 1. While we're here
add another assert for the issue fixed by the previous commit.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111251
Fixes: 156306e5e62 ("nir/find_array_copies: Handle wildcards and overlapping copies")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/compiler/nir/nir_opt_find_array_copies.c