summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-05-04 07:35:44 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-05-04 07:35:44 -0700
commit5be89bc80f7f235805ec706f1ff13e6952f0d34e (patch)
tree0d9a26ddd0314f589127fd74837348ab6b1cdd54
parent159139d01de827e8e7232e2b74b2fc142612d8e2 (diff)
downloadtxr-5be89bc80f7f235805ec706f1ff13e6952f0d34e.tar.gz
txr-5be89bc80f7f235805ec706f1ff13e6952f0d34e.tar.bz2
txr-5be89bc80f7f235805ec706f1ff13e6952f0d34e.zip
parser: fix regression in #; syntax.
A crash has showed up when processing commented-out objects. This is due to the most recent gc fix to the parser. * parser.y (set_syntax_tree): Avoid the set macro when tree has the special value nao (not an object). * y.tab.c.shipped: Regenerated. * y.tab.h.shipped: Likewise.
-rw-r--r--parser.y5
-rw-r--r--y.tab.c.shipped5
-rw-r--r--y.tab.h.shipped2
3 files changed, 9 insertions, 3 deletions
diff --git a/parser.y b/parser.y
index 3c51b69d..875a808e 100644
--- a/parser.y
+++ b/parser.y
@@ -1400,7 +1400,10 @@ void yydebug_onoff(int val)
static void set_syntax_tree(parser_t *parser, val tree)
{
- set(mkloc(parser->syntax_tree, parser->parser), tree);
+ if (tree == nao)
+ parser->syntax_tree = tree;
+ else
+ set(mkloc(parser->syntax_tree, parser->parser), tree);
}
static val sym_helper(parser_t *parser, wchar_t *lexeme, val meta_allowed)
diff --git a/y.tab.c.shipped b/y.tab.c.shipped
index 2df3bdb9..526f2eef 100644
--- a/y.tab.c.shipped
+++ b/y.tab.c.shipped
@@ -6743,7 +6743,10 @@ void yydebug_onoff(int val)
static void set_syntax_tree(parser_t *parser, val tree)
{
- set(mkloc(parser->syntax_tree, parser->parser), tree);
+ if (tree == nao)
+ parser->syntax_tree = tree;
+ else
+ set(mkloc(parser->syntax_tree, parser->parser), tree);
}
static val sym_helper(parser_t *parser, wchar_t *lexeme, val meta_allowed)
diff --git a/y.tab.h.shipped b/y.tab.h.shipped
index 19ec4906..82de207d 100644
--- a/y.tab.h.shipped
+++ b/y.tab.h.shipped
@@ -154,7 +154,7 @@ typedef union YYSTYPE
{
/* Line 2068 of yacc.c */
-#line 106 "parser.y"
+#line 107 "parser.y"
wchar_t *lexeme;
union obj *val;