diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2007-08-24 14:39:25 +0000 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2007-08-24 14:39:25 +0000 |
commit | 9d693d807fbd77761cf1c35de1bcbcfc91d690e4 (patch) | |
tree | 96b91753f6e548e0b854959fd5913dfadc14aae2 /lisp/emacs-lisp | |
parent | ee163e6dbc0b62323e9754c89f1cc4ea42d80b35 (diff) | |
download | emacs-9d693d807fbd77761cf1c35de1bcbcfc91d690e4.tar.gz emacs-9d693d807fbd77761cf1c35de1bcbcfc91d690e4.tar.bz2 emacs-9d693d807fbd77761cf1c35de1bcbcfc91d690e4.zip |
(byte-optimize-if): Don't presume `clause' is a list.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/byte-opt.el | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index b4eaf4ff5eb..80a6ad595b2 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -1020,7 +1020,9 @@ ;; (if <test> nil <else...>) ==> (if (not <test>) (progn <else...>)) ;; (if <test> <then> nil) ==> (if <test> <then>) (let ((clause (nth 1 form))) - (cond ((eq (car clause) 'progn) + (cond ((and (eq (car-safe clause) 'progn) + ;; `clause' is a proper list. + (null (cdr (last clause)))) (if (null (cddr clause)) ;; A trivial `progn'. (byte-optimize-if `(if ,(cadr clause) ,@(nthcdr 2 form))) |