summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-13 00:40:32 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-13 00:40:32 +0000
commit4a883ff9a8b1333cdc5b1cc65c46c775a47559bb (patch)
treefb9f6995923a555cc6d0963f09dd63c4c500d003 /parse.y
parentd5526c660d64ee31341970816fbad8aaf0c27440 (diff)
parse.y: keep nodes linking
* parse.y (remove_duplicate_keys): should keep nodes linking not to be collected. [Bug #10315] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y6
1 files changed, 3 insertions, 3 deletions
diff --git a/parse.y b/parse.y
index af0f362847..5abd889f3c 100644
--- a/parse.y
+++ b/parse.y
@@ -9601,6 +9601,9 @@ append_literal_keys(st_data_t k, st_data_t v, st_data_t h)
{
NODE *node = (NODE *)v;
NODE **result = (NODE **)h;
+ node->nd_alen = 2;
+ node->nd_next->nd_end = node->nd_next;
+ node->nd_next->nd_next = 0;
if (*result)
list_concat(*result, node);
else
@@ -9619,9 +9622,6 @@ remove_duplicate_keys(struct parser_params *parser, NODE *hash)
NODE *next = value->nd_next;
VALUE key = (VALUE)head;
st_data_t data;
- hash->nd_alen = 2;
- value->nd_end = value;
- value->nd_next = 0;
if (nd_type(head) == NODE_LIT &&
st_lookup(literal_keys, (key = head->nd_lit), &data)) {
rb_compile_warn(ruby_sourcefile, nd_line((NODE *)data),