From: Tobias C. Rittweiler <tcr@fr...> - 2009-10-22 16:12:16
Levente Mészáros <levente.meszaros@...> writes:
> The following form errors in SBCL 188.8.131.52 x86-64.
> 'common-lisp:structure-object :structure)
The error is because
for the following symbols
returns 0 rather than NIL.
The reason for that (this insight came from Xof) is that the LAYOUT
classoid is also actually initialized by genesis and in MAKE-COLD-LAYOUT
(cold-set-layout-slot result 'source-location *nil-descriptor*)
A comment in code/class.lisp just above the defstruct definition of
LAYOUT says that this initialization should probably be automated, and I
agree. But that's somewhat outside my capabilities now because I'm
drowning in related KLUDGEs and FIXMEs.
For example the FIXME in %INIT-OR-CHECK-LAYOUT (class.lisp) seems also
apropos to be fixed in one go.
All I can provide is a test case which checks that each class/structure
has a non-bogus source-location. This test could be extended to cover
not only class/structures but everything in the infodb.
Say if you want me to do that. I'll decline to provide a patch for the
actual issue, though.
(dolist (env sb-c::*info-environment*)
(sb-c::do-info (env :class class :type type :name info-name :value value)
(when (and (symbolp info-name)
(eql class :type)
(eql type :kind))
(let* ((classoid (sb-kernel:find-classoid info-name nil))
(layout (and classoid (sb-kernel:classoid-layout classoid)))
(srcloc (and layout (sb-kernel::layout-source-location layout))))
(when (and layout)
(assert (or (sb-c::definition-source-location-p srcloc)