summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-01-14 16:15:25 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-01-14 16:15:25 +0900
commit6bcc4664bdaebbf9b28a762ae63f476a1ec6cfb2 (patch)
treec0bf8927b2e3c8273fadd2ac7d6b7694ee439645
parentbb40c5cbe977de9f36a2a739e94e9b2fd4496b6e (diff)
Return new NODE_LIT
As NODE_ZLIST/NODE_LIST are not markable, cannot be reused as NODE_LIT.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4069
-rw-r--r--parse.y7
1 files changed, 2 insertions, 5 deletions
diff --git a/parse.y b/parse.y
index 29784f3c6a5..ddaa9f67498 100644
--- a/parse.y
+++ b/parse.y
@@ -11148,9 +11148,7 @@ shareable_literal_constant(struct parser_params *p, enum shareability shareable,
case NODE_ZLIST:
lit = rb_ary_new();
OBJ_FREEZE_RAW(lit);
- nd_set_type(value, NODE_LIT);
- RB_OBJ_WRITE(p->ast, &value->nd_lit, lit);
- return value;
+ return NEW_LIT(lit, loc);
case NODE_LIST:
lit = rb_ary_new();
@@ -11235,8 +11233,7 @@ shareable_literal_constant(struct parser_params *p, enum shareability shareable,
value = make_shareable_node(p, value, false, loc);
}
else {
- nd_set_type(value, NODE_LIT);
- RB_OBJ_WRITE(p->ast, &value->nd_lit, rb_ractor_make_shareable(lit));
+ value = NEW_LIT(rb_ractor_make_shareable(lit), loc);
}
return value;