summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-11-08 21:03:05 -0800
committerKaz Kylheku <kaz@kylheku.com>2016-11-08 21:03:05 -0800
commit2288fbc1a6e96f98178d4bdc09aac4c34916039f (patch)
tree7e6cd8395223e4b7e50d606531331e43b4f7d044
parent5b2d2f1a47269518031f643c4f8fc3e62ddf84cf (diff)
downloadtxr-2288fbc1a6e96f98178d4bdc09aac4c34916039f.tar.gz
txr-2288fbc1a6e96f98178d4bdc09aac4c34916039f.tar.bz2
txr-2288fbc1a6e96f98178d4bdc09aac4c34916039f.zip
Don't access *print-circle* in early init.
* lib.c (obj_print): Check that print_circle_s has been interned before trying to look it up as a variable. Otherwise the auto-load code will be triggered, and try to use a hash table that doesn't exist yet. This can happen when this code is called during early initialization.
-rw-r--r--lib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib.c b/lib.c
index b45547b3..8f1ca8c4 100644
--- a/lib.c
+++ b/lib.c
@@ -9631,7 +9631,7 @@ val obj_print(val obj, val out, val pretty)
ctx->obj_hash = ctx->obj_hash_prev;
ctx->obj_hash_prev = nil;
} else {
- if (cdr(lookup_var(nil, print_circle_s))) {
+ if (print_circle_s && cdr(lookup_var(nil, print_circle_s))) {
ctx = &ctx_struct;
ctx->obj_hash = make_hash(nil, nil, nil);
ctx->obj_hash_prev = nil;