X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fpcl%2Fwrapper.lisp;h=eb567cd36ba5854f73daedceb8faffb901b1ba73;hb=6bbc22725d3bf663726ed9adca544e39316364a6;hp=1e8b2f83b9d67f54c2256e7fd67ac8ac482b1dd8;hpb=f73aadf04d841e0f1bfede4c11a13c4ba5c4e264;p=sbcl.git diff --git a/src/pcl/wrapper.lisp b/src/pcl/wrapper.lisp index 1e8b2f8..eb567cd 100644 --- a/src/pcl/wrapper.lisp +++ b/src/pcl/wrapper.lisp @@ -152,6 +152,9 @@ (remhash owrapper *previous-nwrappers*) (setf (gethash nwrapper *previous-nwrappers*) new-previous))) +;;; FIXME: This is not a good name: part of the constract here is that +;;; we return the valid wrapper, which is not obvious from the name +;;; (or the names of our callees.) (defun check-wrapper-validity (instance) (let* ((owrapper (wrapper-of instance)) (state (layout-invalid owrapper))) @@ -187,6 +190,12 @@ (defun check-obsolete-instance (instance) (when (invalid-wrapper-p (layout-of instance)) (check-wrapper-validity instance))) + +(defun valid-wrapper-of (instance) + (let ((wrapper (wrapper-of instance))) + (if (invalid-wrapper-p wrapper) + (check-wrapper-validity instance) + wrapper))) ;;; NIL: means nothing so far, no actual arg info has NILs in the ;;; metatype.