diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 4a418c1aadebc..8d65d6c1c65e3 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -3283,11 +3283,13 @@ comp-call-optim-func 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)))))))