Mercurial > emacs
comparison src/print.c @ 80621:57acb523331b
(print_object): Check print_depth before searching for circularities.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Mon, 21 Jul 2008 05:05:56 +0000 |
parents | fc2bcd2a8aad |
children | b0f1f79e0a17 |
comparison
equal
deleted
inserted
replaced
80620:b27502af61f9 | 80621:57acb523331b |
---|---|
1485 { | 1485 { |
1486 char buf[40]; | 1486 char buf[40]; |
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) |
1493 || (! NILP (Vprint_gensym) | 1497 || (! NILP (Vprint_gensym) |
1494 && SYMBOLP (obj) | 1498 && SYMBOLP (obj) |
1535 } | 1539 } |
1536 } | 1540 } |
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 { |
1546 PRINTCHAR ('\n'); | 1547 PRINTCHAR ('\n'); |
1547 print_chars = 0; | 1548 print_chars = 0; |