diff options
author | Nobuyoshi Nakada <[email protected]> | 2021-01-14 16:15:25 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2021-01-14 16:15:25 +0900 |
commit | 6bcc4664bdaebbf9b28a762ae63f476a1ec6cfb2 (patch) | |
tree | c0bf8927b2e3c8273fadd2ac7d6b7694ee439645 /parse.y | |
parent | bb40c5cbe977de9f36a2a739e94e9b2fd4496b6e (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
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -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; |