1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-29 08:31:35 -08:00

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.
This commit is contained in:
Pip Cet 2021-03-06 20:53:57 +00:00
parent 3848f3bff0
commit 6c73418c95

View file

@ -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)))))))