It's not checking for <0
* (defvar *v* (vector 1))
* (defun foo (vec index) (sb-kernel:%check-bound vec (length vec) index))
* (foo *v* -1)
* (foo *v* -2)
* (foo *v* 3)
debugger invoked on a SB-INT:INVALID-ARRAY-INDEX-ERROR:
Index 3 out of bounds for (SIMPLE-VECTOR 1), should be nonnegative and <1.
The vop generates a cmp and a bne -
(inst cmp index bound)
(inst b :ge error)
I think maybe the :ge needs to be :hs instead? I'm going to try that out, write a test, etc.