Forward referenced classoid-cells can now be loaded from FASLs.
authorStas Boukarev <stassats@gmail.com>
Thu, 3 Oct 2013 16:28:05 +0000 (20:28 +0400)
committerStas Boukarev <stassats@gmail.com>
Thu, 3 Oct 2013 16:28:05 +0000 (20:28 +0400)
When
(defun x (x)
  (typep x 'bar))

(defclass bar ()
  ())

is compiled twice, the typecheck is optimized and a classoid-cell is
dumped into the FASL, but upon load in a new instance it's
reconstructed using FIND-CLASSOID-CELL with :errorp t, resulting in an
error, defeating the stated reason for indirection.

Fixes lp#746132.

NEWS
src/code/class.lisp
src/code/early-type.lisp

diff --git a/NEWS b/NEWS
index 062aa90..35a671d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,8 @@ changes relative to sbcl-1.1.12:
     ** use the whole of the positive-fixnum range for SXHASH of fixnums
   * enhancement: The error message when calling an undefined alien function
     includes the name of the function on x86-64.
+  * bug fix: forward references to classes in fasls can now be loaded.
+    (lp#746132)
 
 changes in sbcl-1.1.12 relative to sbcl-1.1.11:
   * enhancement: Add sb-bsd-sockets:socket-shutdown, for calling
index 6b868bd..fc7ed29 100644 (file)
              (:make-load-form-fun (lambda (c)
                                     `(find-classoid-cell
                                       ',(classoid-cell-name c)
-                                      :errorp t)))
+                                      :create t)))
              #-no-ansi-print-object
              (:print-object (lambda (s stream)
                               (print-unreadable-object (s stream :type t)
index a5f8e30..de364eb 100644 (file)
                               (type-hash-value rest)
                               42)
                           ;; Results (logand #xFF (sxhash t/nil))
-                          ;; hardcoded to avoid relying on the xc host. 
+                          ;; hardcoded to avoid relying on the xc host.
                           (if allowp
                               194
                               11))