[Openmcl-cvs-notifications] r13160 - /release/1.4/source/cocoa-ide/hemlock/src/charprops.lisp

rme at clozure.com rme at clozure.com
Mon Nov 2 12:30:21 EST 2009


Author: rme
Date: Mon Nov  2 12:30:20 2009
New Revision: 13160

Log:
Merge 13130 from trunk (don't crash in split-line-charprops if
the line-charprops-changes is an empty vector)

Modified:
    release/1.4/source/cocoa-ide/hemlock/src/charprops.lisp

Modified: release/1.4/source/cocoa-ide/hemlock/src/charprops.lisp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- release/1.4/source/cocoa-ide/hemlock/src/charprops.lisp (original)
+++ release/1.4/source/cocoa-ide/hemlock/src/charprops.lisp Mon Nov  2 12:3=
0:20 2009
@@ -186,8 +186,9 @@
 ;;; Returns two values: fresh charprops change vectors for the line's char=
acters
 ;;; before and after charpos.
 (defun split-line-charprops (line charpos)
-  (let ((changes (line-charprops-changes line)))
-    (when changes
+  (let* ((changes (line-charprops-changes line))
+         (nchanges (length changes)))
+    (when (> nchanges 0)
       (let ((left (make-array 2 :adjustable t :fill-pointer 0))
             (right (make-array 2 :adjustable t :fill-pointer 0))
             (pivot nil)
@@ -195,7 +196,7 @@
         (do* ((i 0 (1+ i))
               (change nil))
              ((or pivot
-                  (=3D i (length changes)))
+                  (=3D i nchanges))
               (if (null pivot)
                 ;; The last change extends to the end of line, so that wil=
l be the
                 ;; charprops in effect at the beginning of the new line.
@@ -213,7 +214,7 @@
                     (let* ((c (copy-charprops-change prior-change)))
                       (setf (charprops-change-index c) 0)
                       (push-charprops-change c right)))
-                  (loop for i from pivot below (length changes)
+                  (loop for i from pivot below nchanges
                     as change =3D (aref changes i)
                     do (decf (charprops-change-index change) charpos)
                     (push-charprops-change (aref changes i) right))))



More information about the Openmcl-cvs-notifications mailing list