summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-10-11 08:26:33 -0700
committerKaz Kylheku <kaz@kylheku.com>2019-10-11 08:26:33 -0700
commit860f0d04fd5f60d9d3e85debd2d158d5073da568 (patch)
tree1b33357560b170e4b043d9585ac28d45b1ecfd2d
parente1608fed99cb278d322a27f68c5cb7458934544d (diff)
downloadtxr-860f0d04fd5f60d9d3e85debd2d158d5073da568.tar.gz
txr-860f0d04fd5f60d9d3e85debd2d158d5073da568.tar.bz2
txr-860f0d04fd5f60d9d3e85debd2d158d5073da568.zip
printer: obj_hash must be eq-based.
The printer must use an eq-based hash table for detecting circularity, otherwise it blows up on circular range objects. * lib.c (obj_print): instantiate ctx->obj_hash as an eq-based hash table, not eql-based.
-rw-r--r--lib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib.c b/lib.c
index 30c3c93c..32335598 100644
--- a/lib.c
+++ b/lib.c
@@ -11852,7 +11852,7 @@ val obj_print(val obj, val out, val pretty)
if (ctx) {
if (cdr(lookup_var(nil, print_circle_s))) {
ctx->obj_hash_prev = ctx->obj_hash;
- ctx->obj_hash = make_hash(nil, nil, nil);
+ ctx->obj_hash = make_eq_hash(nil, nil);
populate_obj_hash(obj, ctx);
obj_hash_merge(ctx->obj_hash_prev, ctx->obj_hash);
ctx->obj_hash = ctx->obj_hash_prev;
@@ -11867,7 +11867,7 @@ val obj_print(val obj, val out, val pretty)
ctx->obj_hash_prev = nil;
ctx->obj_hash = if2(print_circle_s &&
cdr(lookup_var(nil, print_circle_s)),
- make_hash(nil, nil, nil));
+ make_eq_hash(nil, nil));
ctx->depth = 0;
get_set_ctx(out, ctx);
if (ctx->obj_hash)