summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/lib.c b/lib.c
index 7241796c..e44cdd23 100644
--- a/lib.c
+++ b/lib.c
@@ -10341,12 +10341,16 @@ val obj_print(val obj, val out, val pretty)
uw_simple_catch_begin;
if (ctx) {
- ctx->obj_hash_prev = ctx->obj_hash;
- ctx->obj_hash = make_hash(nil, nil, nil);
- populate_obj_hash(obj, ctx);
- obj_hash_merge(ctx->obj_hash_prev, ctx->obj_hash);
- ctx->obj_hash = ctx->obj_hash_prev;
- ctx->obj_hash_prev = nil;
+ if (cdr(lookup_var(nil, print_circle_s))) {
+ ctx->obj_hash_prev = ctx->obj_hash;
+ ctx->obj_hash = make_hash(nil, nil, nil);
+ populate_obj_hash(obj, ctx);
+ obj_hash_merge(ctx->obj_hash_prev, ctx->obj_hash);
+ ctx->obj_hash = ctx->obj_hash_prev;
+ ctx->obj_hash_prev = nil;
+ } else {
+ ctx = 0;
+ }
} else {
if (print_circle_s && cdr(lookup_var(nil, print_circle_s))) {
ctx = &ctx_struct;