1.0.2.19: Fix fopcompiling references to undefined variables
authorJuho Snellman <jsnell@iki.fi>
Tue, 6 Feb 2007 18:24:55 +0000 (18:24 +0000)
committerJuho Snellman <jsnell@iki.fi>
Tue, 6 Feb 2007 18:24:55 +0000 (18:24 +0000)
        * 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

src/compiler/fopcompile.lisp
tests/fopcompiler.impure-cload.lisp
version.lisp-expr

index 31e87f6..3162a8a 100644 (file)
                      (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)
index b4f58fb..7b117a8 100644 (file)
@@ -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))
index df6b983..de2783e 100644 (file)
@@ -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"