summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/comp.el
diff options
context:
space:
mode:
authorAndrea Corallo <akrl@sdf.org>2020-03-23 15:57:48 +0000
committerAndrea Corallo <akrl@sdf.org>2020-03-23 20:37:59 +0000
commitf8b07ff4f318d799a471c9363903e3929fd5c844 (patch)
tree060a73d3902fe84ecdbad5a8464f652b22a5eb4c /lisp/emacs-lisp/comp.el
parenteb1d22b136a3f7a49b4060553b79ee188f55a498 (diff)
downloademacs-f8b07ff4f318d799a471c9363903e3929fd5c844.tar.gz
emacs-f8b07ff4f318d799a471c9363903e3929fd5c844.tar.bz2
emacs-f8b07ff4f318d799a471c9363903e3929fd5c844.zip
Guard against function redefinition during deferred load
Diffstat (limited to 'lisp/emacs-lisp/comp.el')
-rw-r--r--lisp/emacs-lisp/comp.el10
1 files changed, 8 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 273b41f5427..c6f2ca13aab 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -1160,12 +1160,15 @@ the annotation emission."
(cl-defgeneric comp-emit-for-top-level (form for-late-load)
"Emit the limple code for top level FORM.")
-(cl-defmethod comp-emit-for-top-level ((form byte-to-native-function) _)
+(cl-defmethod comp-emit-for-top-level ((form byte-to-native-function)
+ for-late-load)
(let* ((name (byte-to-native-function-name form))
(f (gethash name (comp-ctxt-funcs-h comp-ctxt)))
(args (comp-func-args f)))
(cl-assert (and name f))
- (comp-emit (comp-call 'comp--register-subr
+ (comp-emit (comp-call (if for-late-load
+ 'comp--late-register-subr
+ 'comp--register-subr)
(make-comp-mvar :constant name)
(make-comp-mvar :constant (comp-args-base-min args))
(make-comp-mvar :constant (if (comp-args-p args)
@@ -2186,6 +2189,9 @@ display a message."
(save-excursion
(goto-char (point-max))
(insert msg "\n")))
+ ;; `comp-deferred-pending-h' should be empty at this stage.
+ ;; Reset it anyway.
+ (setf comp-deferred-pending-h (make-hash-table :equal #'eq))
(message msg))))