summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2019-09-05 11:04:43 -0700
committerAaron Patterson <tenderlove@ruby-lang.org>2019-09-05 11:04:43 -0700
commit8f096226e1b76f95f4d853d3dea2bc75eeeb5244 (patch)
tree74860932a1cc5ab53e959b9d29e1d6c4c8848f28 /parse.y
parent8cd845aa5b69e49c1092a482f8c14f85f899e038 (diff)
Stash tmpbuffer inside internal structs
I guess those AST node were actually used for something, so we'd better not touch them. Instead this commit just puts the tmpbuffer inside a different internal struct so that we can mark them.
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y6
1 files changed, 4 insertions, 2 deletions
diff --git a/parse.y b/parse.y
index 7a0bbe0f95..29b8628e39 100644
--- a/parse.y
+++ b/parse.y
@@ -11128,8 +11128,9 @@ new_args_tail(struct parser_params *p, NODE *kw_args, ID kw_rest_arg, ID block,
args = ZALLOC(struct rb_args_info);
VALUE tmpbuf = rb_imemo_tmpbuf_auto_free_pointer(args);
+ args->imemo = tmpbuf;
RB_OBJ_WRITTEN(p->ast, Qnil, tmpbuf);
- node = NEW_NODE(NODE_ARGS, tmpbuf, 0, args, &NULL_LOC);
+ node = NEW_NODE(NODE_ARGS, 0, 0, args, &NULL_LOC);
if (p->error_p) return node;
args->block_arg = block;
@@ -11237,7 +11238,8 @@ new_array_pattern_tail(struct parser_params *p, NODE *pre_args, int has_rest, ID
apinfo = ZALLOC(struct rb_ary_pattern_info);
VALUE tmpbuf = rb_imemo_tmpbuf_auto_free_pointer(apinfo);
- node = NEW_NODE(NODE_ARYPTN, tmpbuf, 0, apinfo, loc);
+ node = NEW_NODE(NODE_ARYPTN, 0, 0, apinfo, loc);
+ apinfo->imemo = tmpbuf;
RB_OBJ_WRITTEN(p->ast, Qnil, tmpbuf);
apinfo->pre_args = pre_args;