]> git.eshelyaron.com Git - emacs.git/commit
Fix local defvar scoping error (bug#46387)
authorMattias Engdegård <mattiase@acm.org>
Wed, 10 Feb 2021 13:26:49 +0000 (14:26 +0100)
committerMattias Engdegård <mattiase@acm.org>
Wed, 10 Feb 2021 13:47:40 +0000 (14:47 +0100)
commitf3ae26cb2ae581a84bbaa15a47e9917a799a5682
tree40b17ab4e754eb4b8407edb42fa1bae11cf44681
parentd9af4167019c4ed4f8605965cdf3e3ff7b72244f
Fix local defvar scoping error (bug#46387)

This bug was introduced by the lexical variable constant propagation
mechanism.  It was discovered by Michael Heerdegen.

* lisp/emacs-lisp/byte-opt.el (byte-optimize-let-form)
(byte-optimize-body): Let the effects of a local defvar declaration be
scoped by let and let*, not any arbitrary Lisp expression body (such
as progn).
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--get-vars)
(bytecomp-local-defvar): New test.
lisp/emacs-lisp/byte-opt.el
test/lisp/emacs-lisp/bytecomp-tests.el