summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2020-11-20 16:45:56 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2020-11-20 16:45:56 -0500
commit2ba2e7217f520a43a098b2ef92a452868b88cc70 (patch)
tree560cda52edb0efe3c177dba1506fbfb967acc138 /lisp/emacs-lisp
parent6924320aebce9ba885877da45e43d8d573da8bf6 (diff)
downloademacs-2ba2e7217f520a43a098b2ef92a452868b88cc70.tar.gz
emacs-2ba2e7217f520a43a098b2ef92a452868b88cc70.tar.bz2
emacs-2ba2e7217f520a43a098b2ef92a452868b88cc70.zip
Don't optimize away `eval` when its lexical context is different
* lisp/emacs-lisp/bytecomp.el (byte-compile-file-form-eval): Obey lexical-binding.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/bytecomp.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index cbda16d051b..e6f6a12b53d 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -2570,7 +2570,8 @@ list that represents a doc string reference.
;; and similar macros cleaner.
(put 'eval 'byte-hunk-handler 'byte-compile-file-form-eval)
(defun byte-compile-file-form-eval (form)
- (if (eq (car-safe (nth 1 form)) 'quote)
+ (if (and (eq (car-safe (nth 1 form)) 'quote)
+ (equal (nth 2 form) lexical-binding))
(nth 1 (nth 1 form))
(byte-compile-keep-pending form)))