mirror of
https://github.com/ruby/ruby.git
synced 2026-01-26 20:19:19 +00:00
Return new NODE_LIT
As NODE_ZLIST/NODE_LIST are not markable, cannot be reused as NODE_LIT.
This commit is contained in:
parent
bb40c5cbe9
commit
6bcc4664bd
Notes:
git
2025-12-15 16:28:42 +00:00
7
parse.y
7
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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user