Add some sanity checking of defun arglist

* lisp/emacs-lisp/byte-run.el (defun):
Check for malformed argument lists.  (Bug#15715)
This commit is contained in:
Nicolas Richard 2016-12-10 17:48:10 -08:00 committed by Glenn Morris
parent 8d1b753d52
commit 0107336165

View file

@ -240,6 +240,10 @@ The return value is undefined.
;; from
;; (defun foo (arg) (toto)).
(declare (doc-string 3) (indent 2))
(if (null
(and (listp arglist)
(null (delq t (mapcar #'symbolp arglist)))))
(error "Malformed arglist: %s" arglist))
(let ((decls (cond
((eq (car-safe docstring) 'declare)
(prog1 (cdr docstring) (setq docstring nil)))