summaryrefslogtreecommitdiff
path: root/node.c
diff options
authoryui-knk <[email protected]>2024-02-10 10:05:18 +0900
committerYuichiro Kaneko <[email protected]>2024-02-21 08:06:48 +0900
commite7ab5d891c3272e72caef6879e90ad8ae4e13dea (patch)
tree018b9b38b1ef3aaf87b6a6a8baf8a72d78460b27 /node.c
parent97d4363d3b4125d30120ab07cb69d3fc34b44bfc (diff)
Introduce NODE_REGX to manage regexp literal
Diffstat (limited to 'node.c')
-rw-r--r--node.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/node.c b/node.c
index 8c579cc272..2828af26fc 100644
--- a/node.c
+++ b/node.c
@@ -195,6 +195,10 @@ free_ast_value(rb_ast_t *ast, void *ctx, NODE *node)
case NODE_SYM:
parser_string_free(ast, RNODE_SYM(node)->string);
break;
+ case NODE_REGX:
+ case NODE_MATCH:
+ parser_string_free(ast, RNODE_REGX(node)->string);
+ break;
case NODE_DSYM:
parser_string_free(ast, RNODE_DSYM(node)->string);
break;
@@ -268,7 +272,6 @@ static bool
nodetype_markable_p(enum node_type type)
{
switch (type) {
- case NODE_MATCH:
case NODE_LIT:
return true;
default:
@@ -374,7 +377,6 @@ mark_and_move_ast_value(rb_ast_t *ast, void *ctx, NODE *node)
#endif
switch (nd_type(node)) {
- case NODE_MATCH:
case NODE_LIT:
rb_gc_mark_and_move(&RNODE_LIT(node)->nd_lit);
break;