[slime-devel] [PATCH] Inspector bug when *slime-inspect-contents-limit* is non-NIL

Madhu enometh at meer.net
Tue Jul 17 06:38:17 UTC 2007


The inspector currently throws an out out of bound error when inspecting
arrays of length less than *slime-inspect-contents-limit*. To see the
bug: set *slime-inspect-contents-limit* to 10 and C-c I "foobar"

The attached patch is in addition to the patch posted in
   <m3fy4ss6ge.fsf at robolove.meer.net>
http://permalink.gmane.org/gmane.lisp.slime.devel/6333


--- swank.lisp.~1.490.~	2007-06-04 21:47:17.000000000 +0530
+++ swank.lisp	2007-07-13 21:30:09.000000000 +0530
@@ -4603,9 +4608,12 @@
            '("Contents:" (:newline))
            (if (and *slime-inspect-contents-limit*
 		    (>= (array-total-size array) *slime-inspect-contents-limit*))
-	       (inspect-bigger-piece-actions array  (length array))
+	       (inspect-bigger-piece-actions array (length array))
 	       nil)
-           (loop for i below (or *slime-inspect-contents-limit* (array-total-size array))
+           (loop with array-size = (array-total-size array)
+                 for i below (if *slime-inspect-contents-limit*
+                                 (min *slime-inspect-contents-limit* array-size)
+                                 array-size)
                  append (label-value-line i (row-major-aref array i))))))
 
 (defmethod inspect-for-emacs ((char character) inspector)




More information about the slime-devel mailing list