From 860f0d04fd5f60d9d3e85debd2d158d5073da568 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 11 Oct 2019 08:26:33 -0700 Subject: 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. --- lib.c | 4 ++-- 1 file 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) -- cgit v1.2.3