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
commit3ccdd5c9bfc6c8a8812ef6dab12dc1a1cd2bc0ee (patch)
tree7e6cd8395223e4b7e50d606531331e43b4f7d044
parent9ad8bad3e65de0181fe4662ec5687738ae49087c (diff)
downloadtxr-3ccdd5c9bfc6c8a8812ef6dab12dc1a1cd2bc0ee.tar.gz
txr-3ccdd5c9bfc6c8a8812ef6dab12dc1a1cd2bc0ee.tar.bz2
txr-3ccdd5c9bfc6c8a8812ef6dab12dc1a1cd2bc0ee.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;