From 535f62165a525852fbc1c5c001e4726ed4f2cbe0 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Fri, 19 Jul 2013 01:10:00 +0200 Subject: LET*, LAMBDA: Fix use of MAYBE-CLOSES-OVER-P to also search references from binding forms. --- sb-eval2.lisp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sb-eval2.lisp b/sb-eval2.lisp index 4aff632..814f05c 100644 --- a/sb-eval2.lisp +++ b/sb-eval2.lisp @@ -443,11 +443,13 @@ (key-num (length keys)) (aux-num (length aux)) (varnum (length argvars)) - (envp (or (> varnum +stack-max+) - (maybe-closes-over-p context `(progn ,@body) argvars))) (default-values (append (mapcar #'lambda-binding-default optional) (mapcar #'lambda-binding-default keys) (mapcar #'lambda-binding-default aux))) + (envp (or (> varnum +stack-max+) + (maybe-closes-over-p context `(progn ,@body) argvars) + (some (lambda (x) (maybe-closes-over-p context x argvars)) + default-values))) (new-context (context-add-env-lexicals context required)) (default-values* (loop for default-value in default-values @@ -789,7 +791,9 @@ (vars (mapcar #'car real-bindings)) (varnum (length vars)) (envp (or (> varnum +stack-max+) - (maybe-closes-over-p context `(progn ,@body) vars))) + (maybe-closes-over-p context `(progn ,@body) vars) + (some (lambda (x) (maybe-closes-over-p context x vars)) + (mapcar #'cdr real-bindings)))) (new-context (context-add-env-lexicals context (list))) lexical-values* -- cgit v1.2.3