summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/gc.c b/gc.c
index ada7047..ae2f0c2 100644
--- a/gc.c
+++ b/gc.c
@@ -1720,7 +1720,6 @@ gc_mark_children(rb_objspace_t *objspace, VALUE ptr, int lev)
case NODE_CALL:
case NODE_DEFS:
case NODE_OP_ASGN1:
- case NODE_ARGS:
gc_mark(objspace, (VALUE)obj->as.node.u1.node, lev);
/* fall through */
case NODE_SUPER: /* 3 */
@@ -1788,6 +1787,18 @@ gc_mark_children(rb_objspace_t *objspace, VALUE ptr, int lev)
ptr = (VALUE)obj->as.node.u2.node;
goto again;
+ case NODE_ARGS: /* custom */
+ {
+ struct rb_args_info *args = obj->as.node.u3.args;
+ if (args) {
+ if (args->pre_init) gc_mark(objspace, (VALUE)args->pre_init, lev);
+ if (args->post_init) gc_mark(objspace, (VALUE)args->post_init, lev);
+ if (args->opt_args) gc_mark(objspace, (VALUE)args->opt_args, lev);
+ }
+ }
+ ptr = (VALUE)obj->as.node.u2.node;
+ goto again;
+
case NODE_ZARRAY: /* - */
case NODE_ZSUPER:
case NODE_VCALL:
@@ -2381,6 +2392,11 @@ obj_free(rb_objspace_t *objspace, VALUE obj)
xfree(RANY(obj)->as.node.u1.tbl);
}
break;
+ case NODE_ARGS:
+ if (RANY(obj)->as.node.u3.args) {
+ xfree(RANY(obj)->as.node.u3.args);
+ }
+ break;
case NODE_ALLOCA:
xfree(RANY(obj)->as.node.u1.node);
break;