aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mackenzie2015-11-29 16:17:07 +0000
committerAlan Mackenzie2015-11-29 16:17:07 +0000
commit5cf012a3a86e700b5f229fc14d9abd1e27fdb5f4 (patch)
tree007fed106f1882801496e684bba53ed8e6ebb65a
parentca6edca2429c01dd7905c0de835bbdb23754b754 (diff)
downloademacs-5cf012a3a86e700b5f229fc14d9abd1e27fdb5f4.tar.gz
emacs-5cf012a3a86e700b5f229fc14d9abd1e27fdb5f4.zip
Byte compiler: Catch missing argument to `funcall'. Fixes bug#22051.
* lisp/emacs-lisp/bytecomp.el (byte-compile-funcall): When there's no argument to `funcall', (i) Output an error message; (ii) Generate code to signal a `wrong-number-of-arguments' error.
-rw-r--r--lisp/emacs-lisp/bytecomp.el9
1 files changed, 7 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 8fd2594fec8..14173494eeb 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -4013,8 +4013,13 @@ that suppresses all warnings during execution of BODY."
4013 (setq byte-compile--for-effect nil))) 4013 (setq byte-compile--for-effect nil)))
4014 4014
4015(defun byte-compile-funcall (form) 4015(defun byte-compile-funcall (form)
4016 (mapc 'byte-compile-form (cdr form)) 4016 (if (cdr form)
4017 (byte-compile-out 'byte-call (length (cdr (cdr form))))) 4017 (progn
4018 (mapc 'byte-compile-form (cdr form))
4019 (byte-compile-out 'byte-call (length (cdr (cdr form)))))
4020 (byte-compile-log-warning "`funcall' called with no arguments" nil :error)
4021 (byte-compile-form '(signal 'wrong-number-of-arguments '(funcall 0))
4022 byte-compile--for-effect)))
4018 4023
4019 4024
4020;; let binding 4025;; let binding