1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Return new NODE_LIT

As NODE_ZLIST/NODE_LIST are not markable, cannot be reused as
NODE_LIT.
This commit is contained in:
Nobuyoshi Nakada 2021-01-14 16:15:25 +09:00
parent bb40c5cbe9
commit 6bcc4664bd
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6
Notes: git 2021-01-14 16:59:47 +09:00

View file

@ -11148,9 +11148,7 @@ shareable_literal_constant(struct parser_params *p, enum shareability shareable,
case NODE_ZLIST: case NODE_ZLIST:
lit = rb_ary_new(); lit = rb_ary_new();
OBJ_FREEZE_RAW(lit); OBJ_FREEZE_RAW(lit);
nd_set_type(value, NODE_LIT); return NEW_LIT(lit, loc);
RB_OBJ_WRITE(p->ast, &value->nd_lit, lit);
return value;
case NODE_LIST: case NODE_LIST:
lit = rb_ary_new(); 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); value = make_shareable_node(p, value, false, loc);
} }
else { else {
nd_set_type(value, NODE_LIT); value = NEW_LIT(rb_ractor_make_shareable(lit), loc);
RB_OBJ_WRITE(p->ast, &value->nd_lit, rb_ractor_make_shareable(lit));
} }
return value; return value;