summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorNoam Postavsky <npostavs@gmail.com>2019-05-27 20:36:41 -0400
committerNoam Postavsky <npostavs@gmail.com>2019-05-30 18:46:07 -0400
commit134edc10367a8434167656e631865c85b5f10c42 (patch)
tree5840d5b40a565a560cd63038c35706e6b8f5f3b4 /lisp
parent5f01af6c8e0f7355f7a99a80ff32369071f65eda (diff)
downloademacs-134edc10367a8434167656e631865c85b5f10c42.tar.gz
Warn about wrong number of args for subrs (Bug#35767)
* lisp/emacs-lisp/bytecomp.el (byte-compile-callargs-warn): Don't assume byte-compile-fdefinition will return non-nil. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-warn-wrong-args) (bytecomp-warn-wrong-args-subr): New tests.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/emacs-lisp/bytecomp.el2
1 files changed, 1 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 9ea4179b68d..72e81a653c7 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -1379,7 +1379,7 @@ 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 def))
+ (sig (byte-compile--function-signature (or def (car form))))
(ncall (length (cdr form))))
;; Check many or unevalled from subr-arity.
(if (and (cdr-safe sig)