Emitting of a scratch variable to facilitate array bounds checking