summaryrefslogtreecommitdiff
path: root/libguile/print.c
diff options
context:
space:
mode:
Diffstat (limited to 'libguile/print.c')
-rw-r--r--libguile/print.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libguile/print.c b/libguile/print.c
index 9c03035da..9a5734446 100644
--- a/libguile/print.c
+++ b/libguile/print.c
@@ -193,6 +193,9 @@ SCM_DEFINE (scm_current_pstate, "current-pstate", 0, 0, 0,
"`current-pstate' is only included in GUILE_DEBUG builds.")
#define FUNC_NAME s_scm_current_pstate
{
+ if (!print_state_pool || SCM_NCONSP(print_state_pool)
+ || SCM_NULLP(SCM_CDR(print_state_pool)))
+ return SCM_BOOL_F;
return SCM_CADR (print_state_pool);
}
#undef FUNC_NAME
@@ -222,7 +225,8 @@ scm_make_print_state ()
/* First try to allocate a print state from the pool */
SCM_DEFER_INTS;
- if (SCM_NNULLP (SCM_CDR (print_state_pool)))
+ if (print_state_pool && SCM_CONSP(print_state_pool) &&
+ SCM_NNULLP (SCM_CDR (print_state_pool)))
{
answer = SCM_CADR (print_state_pool);
SCM_SETCDR (print_state_pool, SCM_CDDR (print_state_pool));