From: Pip Cet Date: Sat, 6 Mar 2021 20:53:57 +0000 (+0000) Subject: Fix miscompilation of funcall forms in some cases (bug#46974) X-Git-Tag: emacs-28.0.90~2727^2~97 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6c73418c95ae5aca7e63d8d5703a90e178350527;p=emacs.git 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. --- 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)))))))