diff options
| author | Andrea Corallo | 2024-03-15 14:18:51 +0100 |
|---|---|---|
| committer | Andrea Corallo | 2024-03-15 14:44:22 +0100 |
| commit | 005536285585bcdf5a67a01cdfd8e1242742f953 (patch) | |
| tree | 98a77cb3c9903de2e6708b8297633eaf6959a9c9 | |
| parent | c393c0467972cba9dc7ed256acd72b553204c33a (diff) | |
| download | emacs-005536285585bcdf5a67a01cdfd8e1242742f953.tar.gz emacs-005536285585bcdf5a67a01cdfd8e1242742f953.zip | |
* Don't install unnecessary trampolines (bug#69573)
* lisp/emacs-lisp/comp-run.el (comp-subr-trampoline-install):
Check that subr-name actually matches the target subr.
| -rw-r--r-- | lisp/emacs-lisp/comp-run.el | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lisp/emacs-lisp/comp-run.el b/lisp/emacs-lisp/comp-run.el index 057760322ab..afb46e3cd19 100644 --- a/lisp/emacs-lisp/comp-run.el +++ b/lisp/emacs-lisp/comp-run.el | |||
| @@ -364,13 +364,15 @@ Return the trampoline if found or nil otherwise." | |||
| 364 | (when (memq subr-name comp-warn-primitives) | 364 | (when (memq subr-name comp-warn-primitives) |
| 365 | (warn "Redefining `%s' might break native compilation of trampolines." | 365 | (warn "Redefining `%s' might break native compilation of trampolines." |
| 366 | subr-name)) | 366 | subr-name)) |
| 367 | (unless (or (null native-comp-enable-subr-trampolines) | 367 | (let ((subr (symbol-function subr-name))) |
| 368 | (memq subr-name native-comp-never-optimize-functions) | 368 | (unless (or (not (string= subr-name (subr-name subr))) ;; (bug#69573) |
| 369 | (gethash subr-name comp-installed-trampolines-h)) | 369 | (null native-comp-enable-subr-trampolines) |
| 370 | (cl-assert (subr-primitive-p (symbol-function subr-name))) | 370 | (memq subr-name native-comp-never-optimize-functions) |
| 371 | (when-let ((trampoline (or (comp-trampoline-search subr-name) | 371 | (gethash subr-name comp-installed-trampolines-h)) |
| 372 | (comp-trampoline-compile subr-name)))) | 372 | (cl-assert (subr-primitive-p subr)) |
| 373 | (comp--install-trampoline subr-name trampoline)))) | 373 | (when-let ((trampoline (or (comp-trampoline-search subr-name) |
| 374 | (comp-trampoline-compile subr-name)))) | ||
| 375 | (comp--install-trampoline subr-name trampoline))))) | ||
| 374 | 376 | ||
| 375 | ;;;###autoload | 377 | ;;;###autoload |
| 376 | (defun native--compile-async (files &optional recursively load selector) | 378 | (defun native--compile-async (files &optional recursively load selector) |