summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/byte-opt.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emacs-lisp/byte-opt.el')
-rw-r--r--lisp/emacs-lisp/byte-opt.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el
index 99b5319ab3d..842697c7245 100644
--- a/lisp/emacs-lisp/byte-opt.el
+++ b/lisp/emacs-lisp/byte-opt.el
@@ -278,7 +278,10 @@
;; first, and then inline its byte-code. This also has the advantage
;; that the final code does not depend on the order of compilation
;; of ELisp files, making the build more reproducible.
- (byte-compile name)
+ ;; Since we are called from inside the optimiser, we need to make
+ ;; sure not to propagate lexvar values.
+ (dlet ((byte-optimize--lexvars nil))
+ (byte-compile name))
`(,(symbol-function name) ,@(cdr form))))
(_ ;; Give up on inlining.