Update of /cvsroot/sbcl/sbcl/src/compiler
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv3593/src/compiler
Modified Files:
fopcompile.lisp
Log Message:
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
Index: fopcompile.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/compiler/fopcompile.lisp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- fopcompile.lisp 18 Jan 2007 00:32:04 -0000 1.6
+++ fopcompile.lisp 6 Feb 2007 18:24:56 -0000 1.7
@@ -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)
|