summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorNoam Postavsky <npostavs@gmail.com>2019-05-31 08:24:56 -0400
committerNoam Postavsky <npostavs@gmail.com>2019-06-01 17:48:43 -0400
commit2860285621eb890697ca122cd6ede8c3f03566d6 (patch)
tree0a3328fe922111ab47dba4c45a3f4833f872bcf5 /lisp
parent008b263feeba8951a95bec93ec0a9e263cf230f7 (diff)
downloademacs-2860285621eb890697ca122cd6ede8c3f03566d6.tar.gz
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).
Diffstat (limited to 'lisp')
-rw-r--r--lisp/emacs-lisp/bytecomp.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 72e81a653c7..e3b34c189f6 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -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)