mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 20:00:19 +02:00
* print.c (scm_iprlist): Bugfix: Added SCM_ECONSP tests in hare
and tortoise scanning loop.
This commit is contained in:
parent
c90c9685af
commit
2fab3faadb
1 changed files with 2 additions and 2 deletions
|
@ -673,12 +673,12 @@ scm_iprlist (hdr, exp, tlr, port, pstate)
|
|||
O(depth * N) instead of O(N^2). */
|
||||
hare = SCM_CDR (exp);
|
||||
tortoise = exp;
|
||||
while (SCM_NIMP (hare))
|
||||
while (SCM_NIMP (hare) && SCM_ECONSP (hare))
|
||||
{
|
||||
if (hare == tortoise)
|
||||
goto fancy_printing;
|
||||
hare = SCM_CDR (hare);
|
||||
if (SCM_IMP (hare))
|
||||
if (SCM_IMP (hare) || SCM_NECONSP (hare))
|
||||
break;
|
||||
hare = SCM_CDR (hare);
|
||||
tortoise = SCM_CDR (tortoise);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue