Compiled COMPILE forms at load time Bug

Madhu enometh at meer.net
Sun Feb 14 18:50:47 CET 2010


CMUCL's file compiler does not correctly compile "top level" COMPILE
forms in the source.  Quick sketch:

$ echo '(compile nil (lambda (x) x))' > foo.lisp
$ lisp -noinit
* (compile-file "foo.lisp")
* (load *)

At FASL Load Time this results in an error, with a `back' stack that
looks like:

Type-error in KERNEL::OBJECT-NOT-TYPE-ERROR-HANDLER:
   NIL is not of type C::DEBUG-SOURCE

0: (FUNCTION-LAMBDA-EXPRESSION #<Function "COMPILE NIL" {5863BFB1}>)
1: (C::GET-LAMBDA-TO-COMPILE #<Function "COMPILE NIL" {5863BFB1}>)
2: ((FLET #:G0 COMPILE))
3: (COMPILE NIL #<Function "COMPILE NIL" {5863BFB1}>)
4: (COMPILE 2 NIL #<Function "COMPILE NIL" {5863BFB1}>)[:EXTERNAL]
5: (C::DO-CALL #<Code Object "Top-Level Form" {5863C087}> 4 5 4 ...)
6: (LISP::FOP-FUNCALL-FOR-EFFECT)
7: (LISP::LOAD-GROUP #<Stream for file "/home/madhu/foo.x86f">)
8: (LISP::FASLOAD #<Stream for file "/home/madhu/foo.x86f">)
9: (LISP::INTERNAL-LOAD #P"/home/madhu/foo.x86f"
                        #P"/home/madhu/foo.x86f"
                        :ERROR :BINARY
                        ...)



[I think this behaviour has been around for a long time (?), and it is a
bug because it prevents you from ensuring compiled functions are stored
in DEFVAR forms.]

--
Madhu




More information about the cmucl-imp mailing list