From 1ab8bfcc2145a100795401de5941c373bb6318eb Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Thu, 29 May 2008 11:16:52 +0000 Subject: [PATCH] 1.0.17.6: fix bug introduced by 1.0.7.3 * References to named constants now need MAYBE-EMIT-LOAD-FORM as well -- so we may just as well move it to FIND-CONSTANT. * Test-case, adepted from Swank. --- src/compiler/ir1tran.lisp | 16 ++++++---------- src/compiler/ir1util.lisp | 6 +++++- tests/compiler.test.sh | 7 +++++++ version.lisp-expr | 2 +- 4 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/compiler/ir1tran.lisp b/src/compiler/ir1tran.lisp index 0caaac5..6f08a8b 100644 --- a/src/compiler/ir1tran.lisp +++ b/src/compiler/ir1tran.lisp @@ -518,20 +518,16 @@ (values)) ;; Generate a reference to a manifest constant, creating a new leaf - ;; if necessary. If we are producing a fasl file, make sure that - ;; MAKE-LOAD-FORM gets used on any parts of the constant that it - ;; needs to be. + ;; if necessary. (defun reference-constant (start next result value) (declare (type ctran start next) (type (or lvar null) result)) (ir1-error-bailout (start next result value) - (when (producing-fasl-file) - (maybe-emit-make-load-forms value)) - (let* ((leaf (find-constant value)) - (res (make-ref leaf))) - (push res (leaf-refs leaf)) - (link-node-to-previous-ctran res start) - (use-continuation res next result))) + (let* ((leaf (find-constant value)) + (res (make-ref leaf))) + (push res (leaf-refs leaf)) + (link-node-to-previous-ctran res start) + (use-continuation res next result))) (values))) ;;; Add FUNCTIONAL to the COMPONENT-REANALYZE-FUNCTIONALS, unless it's diff --git a/src/compiler/ir1util.lisp b/src/compiler/ir1util.lisp index 3596ec2..29fa7cd 100644 --- a/src/compiler/ir1util.lisp +++ b/src/compiler/ir1util.lisp @@ -1568,9 +1568,13 @@ ;;; Return a LEAF which represents the specified constant object. If ;;; the object is not in *CONSTANTS*, then we create a new constant -;;; LEAF and enter it. +;;; LEAF and enter it. If we are producing a fasl file, make sure that +;;; MAKE-LOAD-FORM gets used on any parts of the constant that it +;;; needs to be. (defun find-constant (object) (flet ((make-it () + (when (producing-fasl-file) + (maybe-emit-make-load-forms object)) (make-constant :value object :%source-name '.anonymous. :type (ctype-of object) diff --git a/tests/compiler.test.sh b/tests/compiler.test.sh index 548f9ee..5679935 100644 --- a/tests/compiler.test.sh +++ b/tests/compiler.test.sh @@ -384,5 +384,12 @@ cat > $tmpfilename < $tmpfilename <