From 87c8495a97540f3e1967a0ba436201d9f46f5246 Mon Sep 17 00:00:00 2001 From: Douglas Katzman Date: Tue, 23 May 2017 11:38:55 -0400 Subject: [PATCH] Crashproof print-object on SPECIALIZER-WITH-OBJECT The class does not actually define a slot named OBJECT. --- src/pcl/print-object.lisp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pcl/print-object.lisp b/src/pcl/print-object.lisp index 4f8df93a6..286d3d85c 100644 --- a/src/pcl/print-object.lisp +++ b/src/pcl/print-object.lisp @@ -153,10 +153,10 @@ (format stream "~D" (cpd-count obj)))) (defmethod print-object ((self specializer-with-object) stream) - (let ((have-obj (slot-boundp self 'object))) - (print-unreadable-object (self stream :type t :identity (not have-obj)) - (when have-obj - (write (slot-value self 'object) :stream stream))))) + (if (and (slot-exists-p self 'object) (slot-boundp self 'object)) + (print-unreadable-object (self stream :type t) + (write (slot-value self 'object) :stream stream)) + (print-unreadable-object (self stream :type t :identity t)))) sb-c:: (defmethod print-object ((self policy) stream) -- 2.11.4.GIT