From 40b2758ace2013f1e2914204a5c27b91eab37409 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 21 Jul 2008 05:05:56 +0000 Subject: [PATCH] (print_object): Check print_depth before searching for circularities. --- src/print.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/print.c b/src/print.c index 88abdacfe60..a474fa31e81 100644 --- a/src/print.c +++ b/src/print.c @@ -1487,6 +1487,10 @@ print_object (obj, printcharfun, escapeflag) QUIT; + /* See similar code in print_preprocess. */ + if (print_depth > PRINT_CIRCLE) + error ("Apparently circular structure being printed"); + /* Detect circularities and truncate them. */ if (STRINGP (obj) || CONSP (obj) || VECTORP (obj) || COMPILEDP (obj) || CHAR_TABLE_P (obj) @@ -1537,9 +1541,6 @@ print_object (obj, printcharfun, escapeflag) print_depth++; - /* See similar code in print_preprocess. */ - if (print_depth > PRINT_CIRCLE) - error ("Apparently circular structure being printed"); #ifdef MAX_PRINT_CHARS if (max_print && print_chars > max_print) { -- 2.39.5