[前][次][番号順一覧][スレッド一覧]

ruby-changes:35816

From: nobu <ko1@a...>
Date: Mon, 13 Oct 2014 09:40:39 +0900 (JST)
Subject: [ruby-changes:35816] nobu:r47898 (trunk): parse.y: keep nodes linking

nobu	2014-10-13 09:40:32 +0900 (Mon, 13 Oct 2014)

  New Revision: 47898

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=47898

  Log:
    parse.y: keep nodes linking
    
    * parse.y (remove_duplicate_keys): should keep nodes linking not
      to be collected.  [Bug #10315]

  Modified files:
    trunk/parse.y
Index: parse.y
===================================================================
--- parse.y	(revision 47897)
+++ parse.y	(revision 47898)
@@ -9601,6 +9601,9 @@ append_literal_keys(st_data_t k, st_data https://github.com/ruby/ruby/blob/trunk/parse.y#L9601
 {
     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_para https://github.com/ruby/ruby/blob/trunk/parse.y#L9622
 	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),

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]