diff options
author | Pip Cet <pipcet@gmail.com> | 2021-03-06 20:53:57 +0000 |
---|---|---|
committer | Pip Cet <pipcet@gmail.com> | 2021-03-06 20:53:57 +0000 |
commit | 6c73418c95ae5aca7e63d8d5703a90e178350527 (patch) | |
tree | 9944af4a56c678b81effd21fcf5a3b4eaf447620 /lisp/emacs-lisp/comp.el | |
parent | 3848f3bff0d39e21ee016ea9c3fae4bf07fc0a57 (diff) | |
download | emacs-6c73418c95ae5aca7e63d8d5703a90e178350527.tar.gz emacs-6c73418c95ae5aca7e63d8d5703a90e178350527.tar.bz2 emacs-6c73418c95ae5aca7e63d8d5703a90e178350527.zip |
Fix miscompilation of funcall forms in some cases (bug#46974)
* lisp/emacs-lisp/comp.el (comp-call-optim-func): Call
comp-cstr-imm-vld-p before relying on comp-cstr-imm to return the
right value.
Diffstat (limited to 'lisp/emacs-lisp/comp.el')
-rw-r--r-- | lisp/emacs-lisp/comp.el | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 8a6e761fe40..134b5a28086 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -3282,11 +3282,13 @@ FUNCTION can be a function-name or byte compiled function." do (comp-loop-insn-in-block b (pcase insn (`(set ,lval (callref funcall ,f . ,rest)) - (when-let ((new-form (comp-call-optim-form-call + (when-let ((ok (comp-cstr-imm-vld-p f)) + (new-form (comp-call-optim-form-call (comp-cstr-imm f) rest))) (setf insn `(set ,lval ,new-form)))) (`(callref funcall ,f . ,rest) - (when-let ((new-form (comp-call-optim-form-call + (when-let ((ok (comp-cstr-imm-vld-p f)) + (new-form (comp-call-optim-form-call (comp-cstr-imm f) rest))) (setf insn new-form))))))) |