diff options
author | Andrea Corallo <akrl@sdf.org> | 2021-03-12 22:19:51 +0100 |
---|---|---|
committer | Andrea Corallo <akrl@sdf.org> | 2021-03-12 22:35:23 +0100 |
commit | d018584814e0c15f13bc458ba54491239b584069 (patch) | |
tree | d9e94eca59cfb014cb405f20202a73f971b60edd /lisp/emacs-lisp/comp.el | |
parent | 82bd6d57d54d4cdb205d921c2476d1dbb17f4188 (diff) | |
download | emacs-d018584814e0c15f13bc458ba54491239b584069.tar.gz emacs-d018584814e0c15f13bc458ba54491239b584069.tar.bz2 emacs-d018584814e0c15f13bc458ba54491239b584069.zip |
* Fix circular dependecy when loading a modified comp.el (bug#47049)
* lisp/emacs-lisp/comp.el (comp-subr-trampoline-install): Move it
before other functional code.
Diffstat (limited to 'lisp/emacs-lisp/comp.el')
-rw-r--r-- | lisp/emacs-lisp/comp.el | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index a62efc7e025..866ee8dcf73 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -648,6 +648,23 @@ Useful to hook into pass checkers.") 'native-compiler-error) +;; Moved early to avoid circularity when comp.el is loaded and +;; `macroexpand' needs to be advised (bug#47049). +;;;###autoload +(defun comp-subr-trampoline-install (subr-name) + "Make SUBR-NAME effectively advice-able when called from native code." + (unless (or (null comp-enable-subr-trampolines) + (memq subr-name comp-never-optimize-functions) + (gethash subr-name comp-installed-trampolines-h)) + (cl-assert (subr-primitive-p (symbol-function subr-name))) + (comp--install-trampoline + subr-name + (or (comp-trampoline-search subr-name) + (comp-trampoline-compile subr-name) + ;; Should never happen. + (cl-assert nil))))) + + (cl-defstruct (comp-vec (:copier nil)) "A re-sizable vector like object." (data (make-hash-table :test #'eql) :type hash-table @@ -3743,20 +3760,6 @@ Return the trampoline if found or nil otherwise." finally (error "Cannot find suitable directory for output in \ `comp-eln-load-path'"))))) -;;;###autoload -(defun comp-subr-trampoline-install (subr-name) - "Make SUBR-NAME effectively advice-able when called from native code." - (unless (or (null comp-enable-subr-trampolines) - (memq subr-name comp-never-optimize-functions) - (gethash subr-name comp-installed-trampolines-h)) - (cl-assert (subr-primitive-p (symbol-function subr-name))) - (comp--install-trampoline - subr-name - (or (comp-trampoline-search subr-name) - (comp-trampoline-compile subr-name) - ;; Should never happen. - (cl-assert nil))))) - ;; Some entry point support code. |