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: 156306e5 ("nir/find_array_copies: Handle wildcards and overlapping copies")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
13 jobs for !1501 with nir-find-copy-fixes in 29 minutes and 25 seconds (queued for 13 seconds)
latest detached
Status Name Job ID Coverage
  Containers Build
passed debian #458761

00:00:25

 
  Build+Test
passed meson-arm64 #458770

00:02:44

passed meson-armhf #458769

00:02:42

passed meson-clang #458763

00:08:26

passed meson-clover #458767

00:07:56

passed meson-i386 #458771

00:01:04

passed meson-main #458766

00:06:05

passed meson-swr-glvnd #458762

00:05:37

passed meson-vulkan #458768

00:02:25

passed scons-llvm #458773

00:07:23

passed scons-nollvm #458772

00:03:18

passed scons-swr #458764

00:05:28

passed scons-win64 #458765

00:06:16