diff options
| author | Chong Yidong | 2008-07-21 05:05:56 +0000 |
|---|---|---|
| committer | Chong Yidong | 2008-07-21 05:05:56 +0000 |
| commit | 40b2758ace2013f1e2914204a5c27b91eab37409 (patch) | |
| tree | 901c5d19259d7b03469c7e18c6f713b8c53c9212 /src | |
| parent | 97a5a9472f06f640adf50473908b606b5dc343c0 (diff) | |
| download | emacs-40b2758ace2013f1e2914204a5c27b91eab37409.tar.gz emacs-40b2758ace2013f1e2914204a5c27b91eab37409.zip | |
(print_object): Check print_depth before searching for circularities.
Diffstat (limited to 'src')
| -rw-r--r-- | src/print.c | 7 |
1 files 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) | |||
| 1487 | 1487 | ||
| 1488 | QUIT; | 1488 | QUIT; |
| 1489 | 1489 | ||
| 1490 | /* See similar code in print_preprocess. */ | ||
| 1491 | if (print_depth > PRINT_CIRCLE) | ||
| 1492 | error ("Apparently circular structure being printed"); | ||
| 1493 | |||
| 1490 | /* Detect circularities and truncate them. */ | 1494 | /* Detect circularities and truncate them. */ |
| 1491 | if (STRINGP (obj) || CONSP (obj) || VECTORP (obj) | 1495 | if (STRINGP (obj) || CONSP (obj) || VECTORP (obj) |
| 1492 | || COMPILEDP (obj) || CHAR_TABLE_P (obj) | 1496 | || COMPILEDP (obj) || CHAR_TABLE_P (obj) |
| @@ -1537,9 +1541,6 @@ print_object (obj, printcharfun, escapeflag) | |||
| 1537 | 1541 | ||
| 1538 | print_depth++; | 1542 | print_depth++; |
| 1539 | 1543 | ||
| 1540 | /* See similar code in print_preprocess. */ | ||
| 1541 | if (print_depth > PRINT_CIRCLE) | ||
| 1542 | error ("Apparently circular structure being printed"); | ||
| 1543 | #ifdef MAX_PRINT_CHARS | 1544 | #ifdef MAX_PRINT_CHARS |
| 1544 | if (max_print && print_chars > max_print) | 1545 | if (max_print && print_chars > max_print) |
| 1545 | { | 1546 | { |