1.0.26.18: Solaris x86-64 support
[sbcl.git] / src / code / pred.lisp
index 7d006cc..ee5c9e8 100644 (file)
@@ -317,18 +317,21 @@ length and have identical components. Other arrays must be EQ to be EQUAL."
               (hash-table-equalp x y)))
         ((%instancep x)
          (let* ((layout-x (%instance-layout x))
-                (len (layout-length layout-x)))
+                (raw-len (layout-n-untagged-slots layout-x))
+                (total-len (layout-length layout-x))
+                (normal-len (- total-len raw-len)))
            (and (%instancep y)
                 (eq layout-x (%instance-layout y))
                 (structure-classoid-p (layout-classoid layout-x))
-                (do ((i 1 (1+ i)))
-                    ((= i len) t)
-                  (declare (fixnum i))
+                (dotimes (i normal-len t)
                   (let ((x-el (%instance-ref x i))
                         (y-el (%instance-ref y i)))
                     (unless (or (eq x-el y-el)
                                 (equalp x-el y-el))
-                      (return nil)))))))
+                      (return nil))))
+                (if (zerop raw-len)
+                    t
+                    (raw-instance-slots-equalp layout-x x y)))))
         ((vectorp x)
          (let ((length (length x)))
            (and (vectorp y)