[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug in vector.lisp



    Date: Thu, 11 Aug 88 13:51:10 EDT
    From: David.McDonald@WB1.CS.CMU.EDU


    There is a bug in loopup-pv-2 in vector.lisp.  The then part of the if:
	    (aref cache (%+ offset 4))
    should be changed to:
	    (aref cache (%+ offset 3))

Yikes, this is a bad bug.  I have fixed this in the version of vector on
arisia.xerox.com.  Anyone using the latest PCL should either FTP a new
version of vector, or make this patch to the version they have.

Thanks for this fix.

;from vector.lisp
(defun lookup-pv-2 (isl w0 i0 w1 i1)
  (let* ((cache *pv-cache-2*)
	 (mask *pv-cache-2-mask*)
	 (offset (%logand mask
			  (%logxor (object-cache-no isl mask)
				   (validate-wrapper i0 w0)
				   (validate-wrapper i1 w1)))))
    (without-interrupts
      (if (and (eq (%svref cache offset) isl)
	       (eq (%svref cache (%1+ offset)) w0)
	       (eq (%svref cache (%+ offset 2)) w1))
	  (aref cache (%+ offset 3))
	  (let ((pv (with-interrupts (lookup-pv-miss isl w0 w1))))
	    (setf (%svref cache offset) isl)
	    (setf (%svref cache (%1+ offset)) w0)
	    (setf (%svref cache (%+ offset 2)) w1)
	    (setf (%svref cache (%+ offset 3)) pv))))))
-------