From 010733616543f86aed9e351d5754d02864c2ea26 Mon Sep 17 00:00:00 2001 From: Nicolas Richard Date: Sat, 10 Dec 2016 17:48:10 -0800 Subject: [PATCH] Add some sanity checking of defun arglist * lisp/emacs-lisp/byte-run.el (defun): Check for malformed argument lists. (Bug#15715) --- lisp/emacs-lisp/byte-run.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el index 818c2683463..69b4f41fef6 100644 --- a/lisp/emacs-lisp/byte-run.el +++ b/lisp/emacs-lisp/byte-run.el @@ -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))) -- 2.39.2