]> git.eshelyaron.com Git - emacs.git/commit
Warn about arity errors in inlining calls (bug#12299)
authorMattias Engdegård <mattiase@acm.org>
Thu, 22 Jul 2021 13:00:17 +0000 (15:00 +0200)
committerMattias Engdegård <mattiase@acm.org>
Fri, 23 Jul 2021 13:19:01 +0000 (15:19 +0200)
commit109ca1bd00b56ba66b123b505d8c2187fded0ef7
tree7da2c0b5b4cf4df05e90b324dfe430304269c7b5
parent4d172946c3953b3990182d794e5bda6a11646e29
Warn about arity errors in inlining calls (bug#12299)

Wrong number of arguments in inlining function calls (to `defsubst` or
explicitly using `inline`) did not result in warnings, or in very
cryptic ones.

* lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand): Add calls
to `byte-compile--check-arity-bytecode`.
* lisp/emacs-lisp/bytecomp.el (byte-compile-emit-callargs-warn)
(byte-compile--check-arity-bytecode): New functions.
(byte-compile-callargs-warn): Use factored-out function.
* test/lisp/emacs-lisp/bytecomp-resources/warn-callargs-defsubst.el:
* test/lisp/emacs-lisp/bytecomp-tests.el ("warn-callargs-defsubst.el"):
New test case.
lisp/emacs-lisp/byte-opt.el
lisp/emacs-lisp/bytecomp.el
test/lisp/emacs-lisp/bytecomp-resources/warn-callargs-defsubst.el [new file with mode: 0644]
test/lisp/emacs-lisp/bytecomp-tests.el