diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-09-02 23:12:22 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-09-30 22:15:28 +0900 |
commit | 7b2bea42a245f2e80b5d2700963fd6b143f6d6b8 (patch) | |
tree | 59bc4509242d0be9f92dc8a5a95d65d6903a4455 /ast.c | |
parent | 65e8a293892800d2201899de51d19ed7ce362bbf (diff) |
Unfreeze string-literal-only interpolated string-literal
[Feature #17104]
Diffstat (limited to 'ast.c')
-rw-r--r-- | ast.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -485,9 +485,15 @@ node_children(rb_ast_t *ast, const NODE *node) case NODE_DXSTR: case NODE_DREGX: case NODE_DSYM: - return rb_ary_new_from_args(3, node->nd_lit, - NEW_CHILD(ast, node->nd_next->nd_head), - NEW_CHILD(ast, node->nd_next->nd_next)); + { + NODE *n = node->nd_next; + VALUE head = Qnil, next = Qnil; + if (n) { + head = NEW_CHILD(ast, n->nd_head); + next = NEW_CHILD(ast, n->nd_next); + } + return rb_ary_new_from_args(3, node->nd_lit, head, next); + } case NODE_EVSTR: return rb_ary_new_from_node_args(ast, 1, node->nd_body); case NODE_ARGSCAT: |