Name dumped MAKE-LOAD-FORM results opaquely

The name had no use except seemingly to disambiguate a call stack
when debugging the compiler per se. Any random name suffices, even if
unstable. (If you "need" that name, you've got bigger problems)
This commit is contained in:
Douglas Katzman 2022-01-19 11:36:29 -05:00
parent c085b7b08d
commit 38be0a3022
2 changed files with 27 additions and 1 deletions

View file

@ -1568,7 +1568,13 @@ necessary, since type inference may take arbitrarily long to converge.")
(fasl-note-dumpable-instance constant fasl)
t)
(t
(let* ((name (write-to-string constant :level 1 :length 2))
;; Allow dumping objects that can't be printed
;; Non-invocation of PRINT-OBJECT is tested by 'mlf.impure-cload.lisp'.
(let* ((name #+sb-xc-host 'blobby ; the name means nothing
#-sb-xc-host
(format nil "the-~A-formerly-known-as-~X"
(type-of constant)
(get-lisp-obj-address constant)))
(info (if init-form
(list constant name init-form)
(list constant))))

View file

@ -0,0 +1,20 @@
(eval-when (:compile-toplevel :load-toplevel :execute)
(defstruct fool x))
(eval-when (:compile-toplevel)
(defmethod make-load-form ((self fool) &optional env)
(declare (ignore env))
`(make-fool :x ,(fool-x self)))
(defparameter *crashy* t)
(defmethod print-object ((self fool) stream)
(if *crashy*
(progn
(setq *crashy* nil)
(error "Sorry!"))
(call-next-method))))
;;; We used to try to "name" everything dumped.
;;; If nothing else, the name should have been written with :READABLY NIL
;;; just in case it was going to signal print-not-readable.
;;; Now we don't print-object at all.
(defvar *foolz*
'#.(list (make-fool :x 1) (make-fool :x 2)))