changeset: 5569:d19b6e3bdf91
tag: tip
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Sat Sep 10 13:17:29 2011 +0100
files: lisp/ChangeLog lisp/cl-macs.el
description:
#'cl-defsubst-expand; avoid mutually-recursive symbol macros.
lisp/ChangeLog addition:
2011-09-10 Aidan Kehoe <kehoea(a)parhasard.net>
* cl-macs.el (cl-defsubst-expand):
Change set 2a6a8da4dd7c of
http://mid.gmane.org/19966.17522.332164.615228@parhasard.net
wasn't sufficiently comprehensive, symbol macros can be mutually
rather than simply recursive, and they can equally hang. Thanks
for the bug report, Michael Sperber, and for the test case,
Stephen Turnbull.
diff -r b039c0f018b8 -r d19b6e3bdf91 lisp/ChangeLog
--- a/lisp/ChangeLog Fri Sep 09 22:50:31 2011 +0100
+++ b/lisp/ChangeLog Sat Sep 10 13:17:29 2011 +0100
@@ -1,3 +1,13 @@
+2011-09-10 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * cl-macs.el (cl-defsubst-expand):
+ Change set 2a6a8da4dd7c of
+
http://mid.gmane.org/19966.17522.332164.615228@parhasard.net
+ wasn't sufficiently comprehensive, symbol macros can be mutually
+ rather than simply recursive, and they can equally hang. Thanks
+ for the bug report, Michael Sperber, and for the test case,
+ Stephen Turnbull.
+
2011-09-09 Aidan Kehoe <kehoea(a)parhasard.net>
* bytecomp.el (byte-compile-from-buffer):
diff -r b039c0f018b8 -r d19b6e3bdf91 lisp/cl-macs.el
--- a/lisp/cl-macs.el Fri Sep 09 22:50:31 2011 +0100
+++ b/lisp/cl-macs.el Sat Sep 10 13:17:29 2011 +0100
@@ -3236,10 +3236,20 @@
(let* ((symbol-macros nil)
(lets (mapcan #'(lambda (argn argv)
(if (or simple (cl-const-expr-p argv))
- (progn (or (eq argn argv)
- (push (list argn argv)
- symbol-macros))
- (and unsafe (list (list argn argv))))
+ (progn
+ ;; Avoid infinite loop on symbol macro
+ ;; expansion, make sure none of the argvs
+ ;; refer to the symbols in the argns.
+ (or (block find
+ ;; Can't use cl-expr-contains, that
+ ;; doesn't descend lambdas:
+ (subst nil argn argvs :test
+ #'(lambda (elt tree)
+ (if (eq elt tree)
+ (return-from find t))))
+ nil)
+ (push (list argn argv) symbol-macros))
+ (and unsafe (list (list argn argv))))
(list (list argn argv))))
argns argvs)))
`(let ,lets
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches