summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-02-24 07:38:26 -0800
committerKaz Kylheku <kaz@kylheku.com>2019-02-24 07:38:26 -0800
commit8b03aa84e1a22252fd3b72c47aa890d50774c84c (patch)
tree2a6877a89a7a6c1a4a7ab18a151facffa21a025d
parentdbc38a2e779bf1803e30581dbbf1d71a259b20e9 (diff)
downloadtxr-8b03aa84e1a22252fd3b72c47aa890d50774c84c.tar.gz
txr-8b03aa84e1a22252fd3b72c47aa890d50774c84c.tar.bz2
txr-8b03aa84e1a22252fd3b72c47aa890d50774c84c.zip
parser: gc bug in handling circular notation.
* parser.c (parser_circ_def): When we lazily add the circ_ref_hash to the parser, this is possibly a wrong-way assignment (pointer to a baby object being stored into a mature object). The handling for this is missing.
-rw-r--r--parser.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/parser.c b/parser.c
index 99c6d728..63796352 100644
--- a/parser.c
+++ b/parser.c
@@ -385,8 +385,10 @@ void parser_resolve_circ(parser_t *p)
void parser_circ_def(parser_t *p, val num, val expr)
{
- if (!p->circ_ref_hash)
+ if (!p->circ_ref_hash) {
p->circ_ref_hash = make_hash(nil, nil, nil);
+ setcheck(p->parser, p->circ_ref_hash);
+ }
{
val new_p = nil;