Array index out of bounds condition checking macro

there’s a “is valid index” macro which I assume does the same thing here