Update of /cvsroot/sbcl/sbcl/tests
In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv8279/tests
Modified Files:
compiler.impure.lisp
Log Message:
1.0.42.25: check parent-lambdas in defined-fun-functional
* Fixes lp#308951.
* REFERENCE-LEAF could gain access to a functional in a strange
lexenv using DEFINED-FUN-FUNCTIONAL, messing up access to bindings.
Don't return a functional if the current lexenvs parent-lambda chain
does not hold the parent of the functional.
Also provides a more elegant fix for MISC.320.
Index: compiler.impure.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/tests/compiler.impure.lisp,v
retrieving revision 1.117
retrieving revision 1.118
diff -u -d -r1.117 -r1.118
--- compiler.impure.lisp 17 Aug 2010 12:26:24 -0000 1.117
+++ compiler.impure.lisp 2 Sep 2010 14:33:05 -0000 1.118
@@ -1197,6 +1197,18 @@
(with-test (:name :defmacro-not-list-lambda-list)
(assert (raises-error? (eval `(defmacro ,(gensym) "foo"))
type-error)))
+
+(with-test (:name :bug-308951)
+ (let ((x 1))
+ (dotimes (y 10)
+ (let ((y y))
+ (when (funcall (eval #'(lambda (x) (eql x 2))) y)
+ (defun bug-308951-foo (z)
+ (incf x (incf y z))))))
+ (defun bug-308951-bar (z)
+ (bug-308951-foo z)
+ (values x)))
+ (assert (= 4 (bug-308951-bar 1))))
;;;; tests not in the problem domain, but of the consistency of the
;;;; compiler machinery itself
|