Commit 28602856 authored by Noam Postavsky's avatar Noam Postavsky

Allow macros autoloaded as functions during bytecomp (Bug#36022)

* lisp/emacs-lisp/bytecomp.el (byte-compile-callargs-warn): Don't pass
symbols which don't have a known definition to
byte-compile--function-signature, it fails to compile code which
previously compiled successfully (for example, gnus.el until
2019-06-01 "* lisp/gnus/gnus.el: Mark autoloaded macros as such" which
autoloads some macros as if they were functions).
parent 008b263f
......@@ -1379,7 +1379,9 @@ when printing the error message."
(defun byte-compile-callargs-warn (form)
(let* ((def (or (byte-compile-fdefinition (car form) nil)
(byte-compile-fdefinition (car form) t)))
(sig (byte-compile--function-signature (or def (car form))))
(sig (cond (def (byte-compile--function-signature def))
((subrp (symbol-function (car form)))
(subr-arity (symbol-function (car form))))))
(ncall (length (cdr form))))
;; Check many or unevalled from subr-arity.
(if (and (cdr-safe sig)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment