From 055ea6cbe74203568d6e038298725fb0f97bfbfe Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 19 Aug 2015 07:47:14 -0700 Subject: Fix parser bug caused by wrong kind of weak hash table. This bug causes the parser associated with a stream to suddenly disappear while reading forms from the stream. Parsing continues, but with a new parser which does not carry the lookahead token from the previous parse. So for instance, we miss the opening parenthesis of the next form. * parser.c (parse_init): The stream_parser_hash must be a hash table with weak keys, but not weak values. We want the association to go away only if the stream becomes unreachable, not if the parser becomes unreachable while the stream is still reachable. --- parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parser.c b/parser.c index bb5205f2..199b0a07 100644 --- a/parser.c +++ b/parser.c @@ -348,6 +348,6 @@ void parse_init(void) unique_s = gensym(nil); prot1(&stream_parser_hash); prot1(&unique_s); - stream_parser_hash = make_hash(t, t, nil); + stream_parser_hash = make_hash(t, nil, nil); parser_l_init(); } -- cgit v1.2.3