causes a TYPE-ERROR
The value NIL is not of type SB-C::PHYSENV.
in MERGE-LETS.
+
+406: functional has external references -- failed aver
+ Given the following food in a single file
+ (eval-when (:compile-toplevel :load-toplevel :execute)
+ (defstruct foo3))
+ (defstruct bar
+ (foo #.(make-foo3)))
+ as of 0.9.18.11 the file compiler breaks on it:
+ failed AVER: "(NOT (FUNCTIONAL-HAS-EXTERNAL-REFERENCES-P CLAMBDA))"
+ Defining the missing MAKE-LOAD-FORM method makes the error go away.
* improvement: GET-INTERNAL-REAL-TIME now reports the time since
startup, not time since first call to GET-INTERNAL-REAL-TIME.
* bug fix: compiler bug triggered by a (non-standard) VALUES
- declaration in a LET* was fixed.
+ declaration in a LET* was fixed. (reported by Kaersten Poeck)
+ * bug fix: file compiler no longer confuses validated and already
+ dumped structurres. (reported by Kaersten Poeck)
* improvements to the Windows port:
** floating point exceptions are now reported correctly.
** stack exhaustion detection works partially.
(dump-byte 0 file))
(dump-pop file))
-;;; Return T iff CONSTANT has not already been dumped. It's been
-;;; dumped if it's in the EQ table.
+;;; Return T iff CONSTANT has already been dumped. It's been dumped if
+;;; it's in the EQ table.
+;;;
+;;; Note: historically (1) the above comment was "T iff ... has not been dumped",
+;;; (2) the test was was also true if the constant had been validated / was in
+;;; the valid objects table. This led to substructures occasionally skipping the
+;;; validation, and hence failing the "must have been validated" test.
(defun fasl-constant-already-dumped-p (constant file)
- (if (or (gethash constant (fasl-output-eq-table file))
- (gethash constant (fasl-output-valid-structures file)))
- t
- nil))
+ (and (gethash constant (fasl-output-eq-table file)) t))
;;; Use HANDLE whenever we try to dump CONSTANT. HANDLE should have been
;;; returned earlier by FASL-DUMP-LOAD-TIME-VALUE-LAMBDA.
(declare (ignore init-form))
(case creation-form
(:sb-just-dump-it-normally
- (fasl-validate-structure constant *compile-object*)
+ ;; FIXME: Why is this needed? If the constant
+ ;; is deemed fopcompilable, then when we dump
+ ;; it we bind *dump-only-valid-structures* to
+ ;; NIL.
+ (fasl-validate-structure value *compile-object*)
(dotimes (i (- (%instance-length value)
(layout-n-untagged-slots
(%instance-ref value 0))))
(defun fopcompile-constant (form for-value-p)
(when for-value-p
+ ;; FIXME: Without this binding the dumper chokes on unvalidated
+ ;; structures: CONSTANT-FOPCOMPILABLE-P validates the structure
+ ;; about to be dumped, not its load-form. Compare and contrast
+ ;; with EMIT-MAKE-LOAD-FORM.
(let ((sb!fasl::*dump-only-valid-structures* nil))
(dump-object form *compile-object*))))
(:ignore-it
nil)
(t
- (when (fasl-constant-already-dumped-p constant *compile-object*)
- (return-from emit-make-load-form nil))
(let* ((name (write-to-string constant :level 1 :length 2))
(info (if init-form
(list constant name init-form)
EOF
expect_clean_compile $tmpfilename
+cat > $tmpfilename <<EOF
+(defstruct foo
+ (bar #p"/tmp/"))
+EOF
+expect_clean_compile $tmpfilename
+
+cat > $tmpfilename <<EOF
+(eval-when (:compile-toplevel :load-toplevel :execute)
+ (defstruct foox)
+ (defmethod make-load-form ((foo foox) &optional env)
+ `(make-foox)))
+(defstruct bar
+ (foo #.(make-foox)))
+EOF
+expect_clean_compile $tmpfilename
+
rm $tmpfilename
rm $compiled_tmpfilename
;;; 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.9.18.11"
+"0.9.18.12"