
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.
9 lines
161 B
EmacsLisp
9 lines
161 B
EmacsLisp
;;; -*- lexical-binding: t -*-
|
|
|
|
(require 'bc-test-beta)
|
|
|
|
(defun bc-test-alpha-f (x)
|
|
(let ((y nil))
|
|
(list y (bc-test-beta-f x))))
|
|
|
|
(provide 'bc-test-alpha)
|