0.8.19.28: fix loading of multiply forward-refrenced layouts
authorNikodemus Siivola <nikodemus@random-state.net>
Wed, 16 Feb 2005 06:02:04 +0000 (06:02 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Wed, 16 Feb 2005 06:02:04 +0000 (06:02 +0000)
           Bug orginally reported and fix provided by Cheuksan Wang,
           basis for test-case provided by Jason Dagit.

NEWS
src/code/class.lisp
tests/undefined-classoid-bug-1.lisp [new file with mode: 0644]
tests/undefined-classoid-bug-2.lisp [new file with mode: 0644]
tests/undefined-classoid-bug.test.sh [new file with mode: 0644]
version.lisp-expr

diff --git a/NEWS b/NEWS
index f007493..a0d9764 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,8 @@
 changes in sbcl-0.8.20 (0.9alpha.0?) relative to sbcl-0.8.19:
   * fixed disassembly of SHLD and SHRD on x86.  (thanks to David
     Lichteblau)
+  * fixed loading of multiply forward-referenced layouts. 
+    (thanks to Cheuksan Wang)
   * fixed bugs 19 and 317: fixed-format floating point printing is
     more accurate.  This also fixes a bug reported by Adam Warner
     related to the ~@F format directive.
index 57ef609..3b0b40d 100644 (file)
   (let ((layout (find-layout name)))
     (init-or-check-layout layout
                          (or (find-classoid name nil)
-                             (make-undefined-classoid name))
+                             (layout-classoid layout))
                          length
                          inherits
                          depthoid)))
diff --git a/tests/undefined-classoid-bug-1.lisp b/tests/undefined-classoid-bug-1.lisp
new file mode 100644 (file)
index 0000000..9d93fca
--- /dev/null
@@ -0,0 +1,5 @@
+(in-package "CL-USER")
+
+(defun a-struct-referencer-1 (struct)
+  (a-struct-slot struct))
+
diff --git a/tests/undefined-classoid-bug-2.lisp b/tests/undefined-classoid-bug-2.lisp
new file mode 100644 (file)
index 0000000..39a0fe8
--- /dev/null
@@ -0,0 +1,6 @@
+(in-package "CL-USER")
+
+(defun a-struct-referencer-2 (struct)
+  (a-struct-slot struct))
+
+(defstruct a-struct slot)
diff --git a/tests/undefined-classoid-bug.test.sh b/tests/undefined-classoid-bug.test.sh
new file mode 100644 (file)
index 0000000..ad05e77
--- /dev/null
@@ -0,0 +1,26 @@
+# This file run a regression test for a bug in loading
+# forward-referenced layouts.
+
+FILES='"undefined-classoid-bug-1.lisp" "undefined-classoid-bug-2.lisp"'
+FASLS='"undefined-classoid-bug-1.fasl" "undefined-classoid-bug-2.fasl"'
+
+${SBCL:-sbcl} <<EOF
+(let ((files (list $FILES)))
+  (mapc #'load files)
+  (mapc #'compile-file files))
+(quit :unix-status 52)
+EOF
+
+${SBCL:-sbcl} <<EOF
+(mapc #'load (list $FASLS))
+(quit :unix-status 52)
+EOF
+
+if [ $? != 52 ]; then
+    rm $FASLS
+    echo undefined-classoid-bug test failed: $?
+    exit 1 # Failure
+fi
+
+# success convention for script
+exit 104
index cc331e9..7684ff3 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.8.19.27"
+"0.8.19.28"