]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve error messaging from byte-compiling dotted lists
authorLars Ingebrigtsen <larsi@gnus.org>
Wed, 22 Sep 2021 21:46:59 +0000 (23:46 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 22 Sep 2021 21:47:04 +0000 (23:47 +0200)
* lisp/emacs-lisp/cconv.el (cconv-analyze-form): Improve error
messaging when byte-compiling dotted lists (bug#35186).

Test case -- byte-compile the following file:

;;;  -*- lexical-binding: t -*-

(defun foo ()
  (+ 1 2)
  (a . b))

lisp/emacs-lisp/cconv.el

index ba29e4ec85e5618df41e5dfe6d99bc0dd740a3de..0a6b04b4c1f332fe5b5ace0b57221be623e18013 100644 (file)
@@ -794,6 +794,8 @@ This function does not return anything but instead fills the
     ;; (`(declare . ,_) nil)               ;The args don't contain code.
 
     (`(,_ . ,body-forms)    ; First element is a function or whatever.
+     (unless (listp body-forms)
+       (signal 'wrong-type-argument (list 'proper-list-p form)))
      (dolist (form body-forms) (cconv-analyze-form form env)))
 
     ((pred symbolp)