summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2019-09-11 11:57:57 -0700
committerAaron Patterson <tenderlove@ruby-lang.org>2019-09-11 11:57:57 -0700
commit14e3731059246fcd093daa36fd0139d0287e633f (patch)
treeaf94aa4f284c6f09b64e952b24396ce38ba90056 /parse.y
parent1febb6f4a14f7222c6d30250bfdc252d34238187 (diff)
Make sure WB executes after object is reachable
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y2
1 files changed, 1 insertions, 1 deletions
diff --git a/parse.y b/parse.y
index 8d7fc69892..bb4191d6f9 100644
--- a/parse.y
+++ b/parse.y
@@ -2787,7 +2787,6 @@ primary : literal
NODE *args, *scope, *internal_var = NEW_DVAR(id, &@2);
ID *tbl = ALLOC_N(ID, 3);
VALUE tmpbuf = rb_imemo_tmpbuf_auto_free_pointer(tbl);
- RB_OBJ_WRITTEN(p->ast, Qnil, tmpbuf);
tbl[0] = 1 /* length of local var table */; tbl[1] = id /* internal id */;
tbl[2] = tmpbuf;
@@ -2809,6 +2808,7 @@ primary : literal
/* {|*internal_id| <m> = internal_id; ... } */
args = new_args(p, m, 0, id, 0, new_args_tail(p, 0, 0, 0, &@2), &@2);
scope = NEW_NODE(NODE_SCOPE, tbl, $5, args, &@$);
+ RB_OBJ_WRITTEN(p->ast, Qnil, tmpbuf);
$$ = NEW_FOR($4, scope, &@$);
fixpos($$, $2);
/*% %*/