changeset 92450:235b5ef31f41

(byte-compile-trueconstp, byte-compile-nilconstp): No recursion in defsubst.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Mon, 03 Mar 2008 21:07:12 +0000
parents 3db1228ead22
children 0fe0ed86b089
files lisp/ChangeLog lisp/emacs-lisp/byte-opt.el
diffstat 2 files changed, 13 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Mon Mar 03 13:55:41 2008 +0000
+++ b/lisp/ChangeLog	Mon Mar 03 21:07:12 2008 +0000
@@ -1,5 +1,8 @@
 2008-03-03  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+	* emacs-lisp/byte-opt.el (byte-compile-trueconstp)
+	(byte-compile-nilconstp): Can't use recursion in a defsubst.
+
 	* textmodes/tex-mode.el (latex-mode): Remove % from paragraph-separate
 	so that M-q can fill comments.
 	(tex-executable-exists-p, tex-compile): Extend with special syntax for
--- a/lisp/emacs-lisp/byte-opt.el	Mon Mar 03 13:55:41 2008 +0000
+++ b/lisp/emacs-lisp/byte-opt.el	Mon Mar 03 21:07:12 2008 +0000
@@ -632,20 +632,28 @@
 
 (defsubst byte-compile-trueconstp (form)
   "Return non-nil if FORM always evaluates to a non-nil value."
+  (while (eq (car-safe form) 'progn)
+    (setq form (car (last (cdr form)))))
   (cond ((consp form)
          (case (car form)
            (quote (cadr form))
-           (progn (byte-compile-trueconstp (car (last (cdr form)))))))
+           ;; Can't use recursion in a defsubst.
+           ;; (progn (byte-compile-trueconstp (car (last (cdr form)))))
+           ))
         ((not (symbolp form)))
         ((eq form t))
         ((keywordp form))))
 
 (defsubst byte-compile-nilconstp (form)
   "Return non-nil if FORM always evaluates to a nil value."
+  (while (eq (car-safe form) 'progn)
+    (setq form (car (last (cdr form)))))
   (cond ((consp form)
          (case (car form)
            (quote (null (cadr form)))
-           (progn (byte-compile-nilconstp (car (last (cdr form)))))))
+           ;; Can't use recursion in a defsubst.
+           ;; (progn (byte-compile-nilconstp (car (last (cdr form)))))
+           ))
         ((not (symbolp form)) nil)
         ((null form))))