X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcode%2Ffull-eval.lisp;h=6f6a88f6adce45fe1746783d47207419115a006f;hb=a160917364f85b38dc0826a5e3dcef87e3c4c62c;hp=0f04a0fafae3a9796b2ef92251a595d2b5fd22a7;hpb=ebe41eb91248cbe3accc890929ddd21827a933d0;p=sbcl.git diff --git a/src/code/full-eval.lisp b/src/code/full-eval.lisp index 0f04a0f..6f6a88f 100644 --- a/src/code/full-eval.lisp +++ b/src/code/full-eval.lisp @@ -185,13 +185,13 @@ ;;; Augment ENV with a local function binding (declaim (inline push-fun)) -(defun push-fun (name value env) +(defun push-fun (name value calling-env body-env) (when (fboundp name) - (let ((sb!c:*lexenv* (env-native-lexenv env))) + (let ((sb!c:*lexenv* (env-native-lexenv calling-env))) (program-assert-symbol-home-package-unlocked :eval name "binding ~A as a local function"))) - (push (cons name value) (env-funs env)) - (push (cons name :bogus) (sb!c::lexenv-funs (env-native-lexenv env)))) + (push (cons name value) (env-funs body-env)) + (push (cons name :bogus) (sb!c::lexenv-funs (env-native-lexenv body-env)))) (sb!int:def!method print-object ((env env) stream) (print-unreadable-object (env stream :type t :identity t))) @@ -682,6 +682,8 @@ (push-fun (car function-def) ;; Evaluate the function definitions in ENV. (eval-local-function-def function-def env) + ;; Do package-lock checks in ENV. + env ;; But add the bindings to the child environment. new-env)) (eval-progn body new-env))))) @@ -698,6 +700,7 @@ (dolist (function-def local-functions) (push-fun (car function-def) (eval-local-function-def function-def env) + old-env env)) ;; And then add an environment for the body of the LABELS. A ;; separate environment from the one where we added the