The diagnostic was confusing and reporting that an array contains far
more elements than it is defined to have, due to casting.
For example, this code:
double foo[4096]; ((char*)foo)[sizeof(foo)];
warns that the "index 32768 is past the end of the array (which contains
32768 elements)."
index is also wrong as you can see from the diagnostic below array index 32768 is past.
I think what you want is index.getNumWords() and size.getNumWords().