Changeset 9452


Ignore:
Timestamp:
May 12, 2008, 3:12:37 PM (11 years ago)
Author:
mb
Message:

Fix bug where %string-equal was attempting to access memory addresses beyond the simple-string argument's end.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/working-0711/ccl/lib/chars.lisp

    r9363 r9452  
    544544    (when (/= len1 len2)
    545545      (return-from %string-equal nil))
     546    (when (zerop len1)
     547      (return-from %string-equal t))
    546548    (macrolet ((.char-equal (a b)
    547549                 ;; not a typo. it's faster to make the char= check and, only if that fails, run the
     
    560562        (declare (type fixnum index1 index2)
    561563                 (type character char1 char2))
    562         (when (eq index1 end1)
    563           (return-from %string-equal t))
    564564        (when (not (.char-equal char1 char2))
    565           (return-from %string-equal nil))))))
     565          (return-from %string-equal nil))
     566        (when (eq index1 (%i- end1 1))
     567          (return-from %string-equal t))))))
    566568
    567569(defun string-lessp (string1 string2 &key start1 end1 start2 end2)
Note: See TracChangeset for help on using the changeset viewer.