From: Alastair Bridgewater Date: Mon, 20 May 2013 19:43:19 +0000 (-0400) Subject: room: Fix reconstituting CONS cells with unbound-marker in the CAR. X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=09c78105eabc6bf2b339f421d4ed1df4678003db;p=sbcl.git room: Fix reconstituting CONS cells with unbound-marker in the CAR. * When I originally rewrote ROOM in terms of RECONSTITUTE-OBJECT, I looked at what constitutes a valid CONS according to the runtime. I noticed that one of the immediate types was an unbound marker and said to myself "nobody's going to put one of those in a list". This turned out to be a mistake. * x86 systems (and plausibly not any others) put unbound-markers in lists when loading FASLs. I have no real idea how or why, but they do. This would lead to an error, "Unrecognized widetag #x4A in reconstitute-object". * Fix, by recording unbound-marker-widetag as being valid as the first word of a CONS cell. * Issue reported by "scymtym" on #sbcl. --- diff --git a/src/code/room.lisp b/src/code/room.lisp index 462474b..b94d9d8 100644 --- a/src/code/room.lisp +++ b/src/code/room.lisp @@ -89,10 +89,9 @@ (let ((cons-info (make-room-info :name 'cons :kind :list))) ;; A cons consists of two words, both of which may be either a - ;; pointer or immediate data. Disregarding the possibility of an - ;; unbound-marker (permitted, according to the GC), this means - ;; either a fixnum, a character, a single-float on a 64-bit system, - ;; or a pointer. + ;; pointer or immediate data. According to the runtime this means + ;; either a fixnum, a character, an unbound-marker, a single-float + ;; on a 64-bit system, or a pointer. (dotimes (i (ash 1 (- n-widetag-bits n-fixnum-tag-bits))) (setf (svref *meta-room-info* (ash i n-fixnum-tag-bits)) cons-info)) @@ -112,6 +111,8 @@ (setf (svref *meta-room-info* character-widetag) cons-info) + (setf (svref *meta-room-info* unbound-marker-widetag) cons-info) + ;; Single-floats are immediate data on 64-bit systems. #!+#.(cl:if (cl:= 64 sb!vm:n-word-bits) '(and) '(or)) (setf (svref *meta-room-info* single-float-widetag) cons-info))