diff src/print.c @ 67637:eb9d3a206a25

Revert last change.
author Chong Yidong <cyd@stupidchicken.com>
date Sat, 17 Dec 2005 15:51:00 +0000
parents b40bbd9c913a
children 5c55209169fc
line wrap: on
line diff
--- a/src/print.c	Sat Dec 17 15:46:16 2005 +0000
+++ b/src/print.c	Sat Dec 17 15:51:00 2005 +0000
@@ -1313,8 +1313,14 @@
 
   /* Give up if we go so deep that print_object will get an error.  */
   /* See similar code in print_object.  */
-  if (print_depth >= PRINT_CIRCLE)
-    error ("Apparently circular structure being printed");
+  /* Because print_preprocess "follows" nested lists in a slightly
+     different order from print_object, there is a risk of giving up
+     too soon.  In that case, a deeply nested circular list may cause
+     print_object to loop.  Using 3 * PRINT_CIRCLE should make this
+     possibility negligible, but at some point someone will have to
+     sit down and do a more careful analysis. -- cyd */
+  if (print_depth >= 3 * PRINT_CIRCLE)
+    return;
 
   /* Avoid infinite recursion for circular nested structure
      in the case where Vprint_circle is nil.  */