From 94736c413ff728833f260acf125ff3a572e270d6 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Wed, 23 Sep 2020 21:56:52 +0200 Subject: Do not install a subr trampoline twice * src/comp.c (syms_of_comp): Define and initialize 'Vcomp_installed_trampolines_h'. (Fcomp__install_trampoline): Fill 'Vcomp_installed_trampolines_h' * lisp/emacs-lisp/comp.el (comp--subr-safe-advice): Make use of `comp-installed-trampolines-h' to guard against installing a trampoline twice. --- lisp/emacs-lisp/comp.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lisp/emacs-lisp/comp.el') diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index e33d58cb406..8b8b111640a 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -2601,7 +2601,8 @@ Return the its filename if found or nil otherwise." ;;;###autoload (defun comp--subr-safe-advice (subr-name) "Make SUBR-NAME effectively advice-able when called from native code." - (unless (memq subr-name comp-never-optimize-functions) + (unless (or (memq subr-name comp-never-optimize-functions) + (gethash subr-name comp-installed-trampolines-h)) (let ((trampoline-sym (comp-trampoline-sym subr-name))) (cl-assert (subr-primitive-p (symbol-function subr-name))) (load (or (comp-search-trampoline subr-name) -- cgit v1.2.3