aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2008-03-03 21:07:12 +0000
committerStefan Monnier2008-03-03 21:07:12 +0000
commit20ce031c4016c61e38945eb67916686b9c59932b (patch)
tree5a209cb2d1dc075016c8e2f4276a95853a730f72
parent68a2af7af02d3e91854d8b1101f48242b5e62b68 (diff)
downloademacs-20ce031c4016c61e38945eb67916686b9c59932b.tar.gz
emacs-20ce031c4016c61e38945eb67916686b9c59932b.zip
(byte-compile-trueconstp, byte-compile-nilconstp): No recursion in defsubst.
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/emacs-lisp/byte-opt.el12
2 files changed, 13 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 7ca350a1a7f..417b4de04d0 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
12008-03-03 Stefan Monnier <monnier@iro.umontreal.ca> 12008-03-03 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * emacs-lisp/byte-opt.el (byte-compile-trueconstp)
4 (byte-compile-nilconstp): Can't use recursion in a defsubst.
5
3 * textmodes/tex-mode.el (latex-mode): Remove % from paragraph-separate 6 * textmodes/tex-mode.el (latex-mode): Remove % from paragraph-separate
4 so that M-q can fill comments. 7 so that M-q can fill comments.
5 (tex-executable-exists-p, tex-compile): Extend with special syntax for 8 (tex-executable-exists-p, tex-compile): Extend with special syntax for
diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el
index 92d83b0ef67..d65cf3904e9 100644
--- a/lisp/emacs-lisp/byte-opt.el
+++ b/lisp/emacs-lisp/byte-opt.el
@@ -632,20 +632,28 @@
632 632
633(defsubst byte-compile-trueconstp (form) 633(defsubst byte-compile-trueconstp (form)
634 "Return non-nil if FORM always evaluates to a non-nil value." 634 "Return non-nil if FORM always evaluates to a non-nil value."
635 (while (eq (car-safe form) 'progn)
636 (setq form (car (last (cdr form)))))
635 (cond ((consp form) 637 (cond ((consp form)
636 (case (car form) 638 (case (car form)
637 (quote (cadr form)) 639 (quote (cadr form))
638 (progn (byte-compile-trueconstp (car (last (cdr form))))))) 640 ;; Can't use recursion in a defsubst.
641 ;; (progn (byte-compile-trueconstp (car (last (cdr form)))))
642 ))
639 ((not (symbolp form))) 643 ((not (symbolp form)))
640 ((eq form t)) 644 ((eq form t))
641 ((keywordp form)))) 645 ((keywordp form))))
642 646
643(defsubst byte-compile-nilconstp (form) 647(defsubst byte-compile-nilconstp (form)
644 "Return non-nil if FORM always evaluates to a nil value." 648 "Return non-nil if FORM always evaluates to a nil value."
649 (while (eq (car-safe form) 'progn)
650 (setq form (car (last (cdr form)))))
645 (cond ((consp form) 651 (cond ((consp form)
646 (case (car form) 652 (case (car form)
647 (quote (null (cadr form))) 653 (quote (null (cadr form)))
648 (progn (byte-compile-nilconstp (car (last (cdr form))))))) 654 ;; Can't use recursion in a defsubst.
655 ;; (progn (byte-compile-nilconstp (car (last (cdr form)))))
656 ))
649 ((not (symbolp form)) nil) 657 ((not (symbolp form)) nil)
650 ((null form)))) 658 ((null form))))
651 659