Add run-time stack index range check