diff options
author | Stefan Kangas <stefankangas@gmail.com> | 2023-03-22 06:30:12 +0100 |
---|---|---|
committer | Stefan Kangas <stefankangas@gmail.com> | 2023-03-22 06:30:12 +0100 |
commit | 2d0de863618fd0341a5a781c26bf774e304ffd45 (patch) | |
tree | 0dc798658c7266775794a96950c088de720687b4 /lisp/emacs-lisp | |
parent | 5904bdf581974cb8bf88534bbc58b13cca797303 (diff) | |
parent | 8b6a0de964d61cb8d57ed3fe65086fa305a3c53e (diff) | |
download | emacs-2d0de863618fd0341a5a781c26bf774e304ffd45.tar.gz |
Merge from origin/emacs-29
8b6a0de964d Improve docstring of treesit-parent-while (bug#62301)
35648a86730 ; Delete accidental leftover '()' Eglot function
47d8e4b0d38 Eglot: report window/workDoneProgress capability to langu...
4a7a0c9a9f5 * lisp/emacs-lisp/comp.el (comp-emit-set-call-subr): Impr...
4a6eefb93a5 Expand defvar-keymap documentation
7a1272168af * lisp/treesit.el (treesit-end-of-defun): Guard arg again...
263d6c38539 Comp fix calls to redefined primtives with op-bytecode (b...
6bf441ff115 Warn package authors away from keymap-unset with REMOVE
786de66ec3c Comment out jobs on EMBA
eed240bc022 Improve defvar-keymap docstring.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/comp.el | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 9f4118dfc86..7d9832f588f 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -1773,17 +1773,25 @@ SP-DELTA is the stack adjustment." (maxarg (cdr arity))) (when (eq maxarg 'unevalled) (signal 'native-ice (list "subr contains unevalled args" subr-name))) - (if (eq maxarg 'many) - ;; callref case. - (comp-emit-set-call (comp-callref subr-name nargs (comp-sp))) - ;; Normal call. - (unless (and (>= maxarg nargs) (<= minarg nargs)) - (signal 'native-ice - (list "incoherent stack adjustment" nargs maxarg minarg))) - (let* ((subr-name subr-name) - (slots (cl-loop for i from 0 below maxarg - collect (comp-slot-n (+ i (comp-sp)))))) - (comp-emit-set-call (apply #'comp-call (cons subr-name slots)))))))) + (if (not (subr-primitive-p subr-name)) + ;; The primitive got redefined before the compiler is + ;; invoked! (bug#61917) + (comp-emit-set-call `(callref funcall + ,(make-comp-mvar :constant subr-name) + ,@(cl-loop repeat nargs + for sp from (comp-sp) + collect (comp-slot-n sp)))) + (if (eq maxarg 'many) + ;; callref case. + (comp-emit-set-call (comp-callref subr-name nargs (comp-sp))) + ;; Normal call. + (unless (and (>= maxarg nargs) (<= minarg nargs)) + (signal 'native-ice + (list "incoherent stack adjustment" nargs maxarg minarg))) + (let* ((subr-name subr-name) + (slots (cl-loop for i from 0 below maxarg + collect (comp-slot-n (+ i (comp-sp)))))) + (comp-emit-set-call (apply #'comp-call (cons subr-name slots))))))))) (eval-when-compile (defun comp-op-to-fun (x) |