Ticket #990 (closed defect: duplicate)
Incorrect code generated for simple loop
|Reported by:||hans||Owned by:|
a user of Hunchentoot has reported problems with Clozure CL and MD5, and I was able to track this down to a problem in CCL (tested with 1.8 on Linux):
Welcome to Clozure Common Lisp Version 1.8-r15286M (LinuxX8632)! ? (defun foo () (let ((block (make-array 16))) (loop for index of-type (integer 0 16) from 0 below 16 do (print index) (setf (aref block index) #x00000000)))) FOO ? (foo) 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 > Error: Array index 16 out of bounds for #<SIMPLE-VECTOR 16> . > While executing: FOO, in process listener(1). > Type :POP to abort, :R for a list of available restarts. > Type :? for other options.
If the type declaration in the loop is omitted, the problem does not occur.