1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-10 05:50:26 +02:00

Fixed printing of weak vectors.

* libguile/print.c (iprin1): When displaying a weak vector, access
  elements via `scm_c_vector_ref ()', not via the macro.

git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-14
This commit is contained in:
Ludovic Courtes 2006-05-02 21:30:58 +00:00 committed by Ludovic Courtès
parent d525e4f9a2
commit c367c4b44e

View file

@ -625,16 +625,30 @@ iprin1 (SCM exp, SCM port, scm_print_state *pstate)
last = pstate->length - 1;
cutp = 1;
}
for (i = 0; i < last; ++i)
if (SCM_I_WVECTP (exp))
{
/* CHECK_INTS; */
scm_iprin1 (SCM_SIMPLE_VECTOR_REF (exp, i), port, pstate);
scm_putc (' ', port);
/* Elements of weak vectors may not be accessed via the
`SIMPLE_VECTOR_REF ()' macro. */
for (i = 0; i < last; ++i)
{
scm_iprin1 (scm_c_vector_ref (exp, i),
port, pstate);
scm_putc (' ', port);
}
}
else
{
for (i = 0; i < last; ++i)
{
scm_iprin1 (SCM_SIMPLE_VECTOR_REF (exp, i), port, pstate);
scm_putc (' ', port);
}
}
if (i == last)
{
/* CHECK_INTS; */
scm_iprin1 (SCM_SIMPLE_VECTOR_REF (exp, i), port, pstate);
scm_iprin1 (scm_c_vector_ref (exp, i), port, pstate);
}
if (cutp)
scm_puts (" ...", port);