]> git.eshelyaron.com Git - emacs.git/commit
Don't propagate lexical variables into inlined functions
authorMattias Engdegård <mattiase@acm.org>
Thu, 27 May 2021 12:03:14 +0000 (14:03 +0200)
committerMattias Engdegård <mattiase@acm.org>
Thu, 27 May 2021 12:16:17 +0000 (14:16 +0200)
commit40d2970f4360bd942ffc3f86db9ff1499a5a5393
treead709ac8bb438e17b724b30b97161776386039d4
parent501296f994ba8b578d8a546eddfd2cdc365305f3
Don't propagate lexical variables into inlined functions

Functions compiled when inlined (thus from inside the optimiser)
mustn't retain the lexical environment of the caller or there will be
tears.  See discussion at
https://lists.gnu.org/archive/html/emacs-devel/2021-05/msg01227.html .

Bug found by Stefan Monnier.

* lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand):
Bind byte-optimize--lexvars to nil when re-entering the compiler
recursively.
* test/lisp/emacs-lisp/bytecomp-resources/bc-test-alpha.el:
* test/lisp/emacs-lisp/bytecomp-resources/bc-test-beta.el: New files.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-defsubst): New test.
lisp/emacs-lisp/byte-opt.el
test/lisp/emacs-lisp/bytecomp-resources/bc-test-alpha.el [new file with mode: 0644]
test/lisp/emacs-lisp/bytecomp-resources/bc-test-beta.el [new file with mode: 0644]
test/lisp/emacs-lisp/bytecomp-tests.el