summaryrefslogtreecommitdiffstats
path: root/parser.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-08-19 07:47:14 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-08-19 07:47:14 -0700
commit055ea6cbe74203568d6e038298725fb0f97bfbfe (patch)
tree2addadf9c0c721d4ba2caa3eca9dec11891e3fa6 /parser.c
parentf057826476218f1c277e6f14870b8f85184e1e38 (diff)
downloadtxr-055ea6cbe74203568d6e038298725fb0f97bfbfe.tar.gz
txr-055ea6cbe74203568d6e038298725fb0f97bfbfe.tar.bz2
txr-055ea6cbe74203568d6e038298725fb0f97bfbfe.zip
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.
Diffstat (limited to 'parser.c')
-rw-r--r--parser.c2
1 files changed, 1 insertions, 1 deletions
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();
}