1
Fork 0
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:
Mikael Djurfeldt 1996-10-03 11:37:38 +00:00
parent c90c9685af
commit 2fab3faadb

View file

@ -673,12 +673,12 @@ scm_iprlist (hdr, exp, tlr, port, pstate)
O(depth * N) instead of O(N^2). */ O(depth * N) instead of O(N^2). */
hare = SCM_CDR (exp); hare = SCM_CDR (exp);
tortoise = exp; tortoise = exp;
while (SCM_NIMP (hare)) while (SCM_NIMP (hare) && SCM_ECONSP (hare))
{ {
if (hare == tortoise) if (hare == tortoise)
goto fancy_printing; goto fancy_printing;
hare = SCM_CDR (hare); hare = SCM_CDR (hare);
if (SCM_IMP (hare)) if (SCM_IMP (hare) || SCM_NECONSP (hare))
break; break;
hare = SCM_CDR (hare); hare = SCM_CDR (hare);
tortoise = SCM_CDR (tortoise); tortoise = SCM_CDR (tortoise);