diff options
| author | Alan Mackenzie | 2015-11-23 14:10:36 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2015-11-23 14:10:36 +0000 |
| commit | 74e5d4e21e7206693ce6ce999e884d75230ad33b (patch) | |
| tree | e194873c06f757626e1eca5db3ce6d40a2bb85b3 | |
| parent | 2b8154f2bc1ad678fdb8e4677cf25359251d5c01 (diff) | |
| download | emacs-74e5d4e21e7206693ce6ce999e884d75230ad33b.tar.gz emacs-74e5d4e21e7206693ce6ce999e884d75230ad33b.zip | |
Don't let cconv_convert insert a nil argument into a `setq' form.
Fixes bug#21983.
* lisp/emacs-lisp/cconv.el (cconv-convert): Don't silently insert a nil last
argument into a `setq' when there're an odd number of args. This enables the
byte compiler to issue a message in this case.
| -rw-r--r-- | lisp/emacs-lisp/cconv.el | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/cconv.el b/lisp/emacs-lisp/cconv.el index efa9a3da011..4a3c273bc84 100644 --- a/lisp/emacs-lisp/cconv.el +++ b/lisp/emacs-lisp/cconv.el | |||
| @@ -477,17 +477,19 @@ places where they originally did not directly appear." | |||
| 477 | (while forms | 477 | (while forms |
| 478 | (let* ((sym (pop forms)) | 478 | (let* ((sym (pop forms)) |
| 479 | (sym-new (or (cdr (assq sym env)) sym)) | 479 | (sym-new (or (cdr (assq sym env)) sym)) |
| 480 | (value (cconv-convert (pop forms) env extend))) | 480 | (value-in-list |
| 481 | (and forms | ||
| 482 | (list (cconv-convert (pop forms) env extend))))) | ||
| 481 | (push (pcase sym-new | 483 | (push (pcase sym-new |
| 482 | ((pred symbolp) `(setq ,sym-new ,value)) | 484 | ((pred symbolp) `(setq ,sym-new ,@value-in-list)) |
| 483 | (`(car-safe ,iexp) `(setcar ,iexp ,value)) | 485 | (`(car-safe ,iexp) `(setcar ,iexp ,@value-in-list)) |
| 484 | ;; This "should never happen", but for variables which are | 486 | ;; This "should never happen", but for variables which are |
| 485 | ;; mutated+captured+unused, we may end up trying to `setq' | 487 | ;; mutated+captured+unused, we may end up trying to `setq' |
| 486 | ;; on a closed-over variable, so just drop the setq. | 488 | ;; on a closed-over variable, so just drop the setq. |
| 487 | (_ ;; (byte-compile-report-error | 489 | (_ ;; (byte-compile-report-error |
| 488 | ;; (format "Internal error in cconv of (setq %s ..)" | 490 | ;; (format "Internal error in cconv of (setq %s ..)" |
| 489 | ;; sym-new)) | 491 | ;; sym-new)) |
| 490 | value)) | 492 | (car value-in-list))) |
| 491 | prognlist))) | 493 | prognlist))) |
| 492 | (if (cdr prognlist) | 494 | (if (cdr prognlist) |
| 493 | `(progn . ,(nreverse prognlist)) | 495 | `(progn . ,(nreverse prognlist)) |