diff options
| author | Nicolas Richard | 2016-12-10 17:48:10 -0800 |
|---|---|---|
| committer | Glenn Morris | 2016-12-10 17:48:10 -0800 |
| commit | 010733616543f86aed9e351d5754d02864c2ea26 (patch) | |
| tree | fbae26aab77b3c13750baa997aac3d400424a681 | |
| parent | 8d1b753d528f741580e48d2b4a6c9b40ca06c08d (diff) | |
| download | emacs-010733616543f86aed9e351d5754d02864c2ea26.tar.gz emacs-010733616543f86aed9e351d5754d02864c2ea26.zip | |
Add some sanity checking of defun arglist
* lisp/emacs-lisp/byte-run.el (defun):
Check for malformed argument lists. (Bug#15715)
| -rw-r--r-- | lisp/emacs-lisp/byte-run.el | 4 |
1 files changed, 4 insertions, 0 deletions
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. | |||
| 240 | ;; from | 240 | ;; from |
| 241 | ;; (defun foo (arg) (toto)). | 241 | ;; (defun foo (arg) (toto)). |
| 242 | (declare (doc-string 3) (indent 2)) | 242 | (declare (doc-string 3) (indent 2)) |
| 243 | (if (null | ||
| 244 | (and (listp arglist) | ||
| 245 | (null (delq t (mapcar #'symbolp arglist))))) | ||
| 246 | (error "Malformed arglist: %s" arglist)) | ||
| 243 | (let ((decls (cond | 247 | (let ((decls (cond |
| 244 | ((eq (car-safe docstring) 'declare) | 248 | ((eq (car-safe docstring) 'declare) |
| 245 | (prog1 (cdr docstring) (setq docstring nil))) | 249 | (prog1 (cdr docstring) (setq docstring nil))) |