summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-10-26 07:01:54 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-10-26 07:01:54 -0700
commit88268ee75421084cc412d26250beb7483f49c1b3 (patch)
tree1a800929f70578eff57ccf389b51bf51a71fa015 /lib.c
parentea81292fa7d10df029d1e938e086bed648ab1120 (diff)
downloadtxr-88268ee75421084cc412d26250beb7483f49c1b3.tar.gz
txr-88268ee75421084cc412d26250beb7483f49c1b3.tar.bz2
txr-88268ee75421084cc412d26250beb7483f49c1b3.zip
obj_print: uw guard frame only when circ printing.
* lib.c (obj_print): Only set up and tear down the continuation-blocking unwind frame when doing circle printing.
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib.c b/lib.c
index f7b75809..5f92b6c1 100644
--- a/lib.c
+++ b/lib.c
@@ -9497,7 +9497,8 @@ val obj_print(val obj, val out, val pretty)
struct strm_ctx *volatile ctx = ctx_orig, ctx_struct;
uw_frame_t cont_guard;
- uw_push_guard(&cont_guard, 1);
+ if (ctx_orig)
+ uw_push_guard(&cont_guard, 1);
uw_simple_catch_begin;
@@ -9528,7 +9529,8 @@ val obj_print(val obj, val out, val pretty)
uw_catch_end;
- uw_pop_frame(&cont_guard);
+ if (ctx_orig)
+ uw_pop_frame(&cont_guard);
return ret;
}