X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fclos.impure.lisp;fp=tests%2Fclos.impure.lisp;h=78647218d9605df3299021fb29072b4aa4d9f596;hb=adcb5a9772b488fce8d0b0195bc6b906a0e69e12;hp=2113f59fc33eeaa18066a1587402f03b78319cc9;hpb=062283b901155792f65775491aea51481c56faaa;p=sbcl.git diff --git a/tests/clos.impure.lisp b/tests/clos.impure.lisp index 2113f59..7864721 100644 --- a/tests/clos.impure.lisp +++ b/tests/clos.impure.lisp @@ -2075,4 +2075,31 @@ (defmethod sb-mop:validate-superclass ((x bug-309076-class) (y standard-class)) t) (assert (typep (make-instance 'bug-309076-class) 'bug-309076-class))) + +(eval-when (:compile-toplevel :load-toplevel :execute) + (require 'sb-cltl2) + (defmethod b ())) + +(defmacro macro () + (let ((a 20)) + (declare (special a)) + (assert + (= + (funcall + (compile nil + (sb-mop:make-method-lambda + #'b + (find-method #'b () ()) + '(lambda () (declare (special a)) a) + nil)) + '(1) ()) + 20)))) + +(with-test (:name :make-method-lambda-leakage) + ;; lambda list of X leaks into the invocation of make-method-lambda + ;; during code-walking performed by make-method-lambda invoked by + ;; DEFMETHOD + (sb-cltl2:macroexpand-all '(defmethod x (a) (macro)))) + + ;;;; success