diff options
author | Andrea Corallo <acorallo@gnu.org> | 2024-03-26 08:20:54 +0100 |
---|---|---|
committer | Andrea Corallo <acorallo@gnu.org> | 2024-03-26 08:32:37 +0100 |
commit | 95d9e6eb6b48b9b51a0b9d7de4a0c4eeed6c7a70 (patch) | |
tree | 699f9339339925c226531e4ac74bf22f686ca310 | |
parent | 38faacf353fb4c8efb027019a4619a386edfe62c (diff) | |
download | emacs-95d9e6eb6b48b9b51a0b9d7de4a0c4eeed6c7a70.tar.gz emacs-95d9e6eb6b48b9b51a0b9d7de4a0c4eeed6c7a70.tar.bz2 emacs-95d9e6eb6b48b9b51a0b9d7de4a0c4eeed6c7a70.zip |
* Don't install unnecessary trampolines (bug#69573) (don't merge)
* lisp/emacs-lisp/comp.el (comp-subr-trampoline-install):
Check that subr-name actually matches the target subr.
-rw-r--r-- | lisp/emacs-lisp/comp.el | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 6b65a375ea0..a3c6bb59469 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -714,13 +714,15 @@ This are essential for the trampoline machinery to work properly.") (when (memq subr-name comp-warn-primitives) (warn "Redefining `%s' might break native compilation of trampolines." subr-name)) - (unless (or (null native-comp-enable-subr-trampolines) - (memq subr-name native-comp-never-optimize-functions) - (gethash subr-name comp-installed-trampolines-h)) - (cl-assert (subr-primitive-p (symbol-function subr-name))) - (when-let ((trampoline (or (comp-trampoline-search subr-name) - (comp-trampoline-compile subr-name)))) - (comp--install-trampoline subr-name trampoline)))) + (let ((subr (symbol-function subr-name))) + (unless (or (not (string= subr-name (subr-name subr))) ;; (bug#69573) + (null native-comp-enable-subr-trampolines) + (memq subr-name native-comp-never-optimize-functions) + (gethash subr-name comp-installed-trampolines-h)) + (cl-assert (subr-primitive-p subr)) + (when-let ((trampoline (or (comp-trampoline-search subr-name) + (comp-trampoline-compile subr-name)))) + (comp--install-trampoline subr-name trampoline))))) (cl-defstruct (comp-vec (:copier nil)) |