From: Juho Snellman Date: Tue, 6 Feb 2007 18:24:55 +0000 (+0000) Subject: 1.0.2.19: Fix fopcompiling references to undefined variables X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=cf65b9804d28c5e6ee2fa53cbac143c2f87f108c;p=sbcl.git 1.0.2.19: Fix fopcompiling references to undefined variables * While undefined, this should be handled the same way in the compiler and the fopcompiler * Signal a warning, use the symbol-value of the slot * Reported by Gregory Vanuxem on sbcl-devel --- diff --git a/src/compiler/fopcompile.lisp b/src/compiler/fopcompile.lisp index 31e87f6..3162a8a 100644 --- a/src/compiler/fopcompile.lisp +++ b/src/compiler/fopcompile.lisp @@ -271,8 +271,18 @@ (fopcompile `(symbol-value ',form) path for-value-p) ;; Lexical (when for-value-p - (sb!fasl::dump-push (cdr (assoc form *fop-lexenv*)) - *compile-object*))))))) + (let ((handle (cdr (assoc form *fop-lexenv*)))) + (if handle + (sb!fasl::dump-push handle + *compile-object*) + (progn + ;; Undefined variable. Signal a warning, and + ;; treat it as a special variable reference, + ;; like the real compiler does. + (note-undefined-reference form :variable) + (fopcompile `(symbol-value ',form) + path + for-value-p)))))))))) ((listp form) (multiple-value-bind (macroexpansion macroexpanded-p) (macroexpand form) diff --git a/tests/fopcompiler.impure-cload.lisp b/tests/fopcompiler.impure-cload.lisp index b4f58fb..7b117a8 100644 --- a/tests/fopcompiler.impure-cload.lisp +++ b/tests/fopcompiler.impure-cload.lisp @@ -78,3 +78,6 @@ (let* ((a 13) (b a)) (assert* (eql b 13))))) + +(setf (symbol-value 'fopcompile-test-foo) 1) +(assert* (eql fopcompile-test-foo 1)) diff --git a/version.lisp-expr b/version.lisp-expr index df6b983..de2783e 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; 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".) -"1.0.2.18" +"1.0.2.19"