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

ruby-changes:33613

From: naruse <ko1@a...>
Date: Thu, 24 Apr 2014 05:59:18 +0900 (JST)
Subject: [ruby-changes:33613] naruse:r45693 (trunk): * parse.y (dsym_node_gen): like r45492, call rb_gc_resurrect().

naruse	2014-04-24 05:59:03 +0900 (Thu, 24 Apr 2014)

  New Revision: 45693

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

  Log:
    * parse.y (dsym_node_gen): like r45492, call rb_gc_resurrect().

  Modified files:
    trunk/ChangeLog
    trunk/parse.y
    trunk/test/ruby/test_symbol.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 45692)
+++ ChangeLog	(revision 45693)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Apr 24 05:50:13 2014  NARUSE, Yui  <naruse@r...>
+
+	* parse.y (dsym_node_gen): like r45492, call rb_gc_resurrect().
+
 Wed Apr 23 20:36:22 2014  Tanaka Akira  <akr@f...>
 
 	* ext/etc/extconf.rb: Build ext/etc unconditionally.
Index: parse.y
===================================================================
--- parse.y	(revision 45692)
+++ parse.y	(revision 45693)
@@ -9571,6 +9571,9 @@ dsym_node_gen(struct parser_params *pars https://github.com/ruby/ruby/blob/trunk/parse.y#L9571
       case NODE_STR:
 	lit = node->nd_lit;
 	node->nd_lit = ID2SYM(rb_intern_str(lit));
+	if (!STATIC_SYM_P(node->nd_lit)) {
+	    rb_gc_resurrect(node->nd_lit);
+	}
 	nd_set_type(node, NODE_LIT);
 	break;
       default:
Index: test/ruby/test_symbol.rb
===================================================================
--- test/ruby/test_symbol.rb	(revision 45692)
+++ test/ruby/test_symbol.rb	(revision 45693)
@@ -221,4 +221,10 @@ class TestSymbol < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_symbol.rb#L221
       assert_equal sym, Symbol.find(str)
     end;
   end
+
+  def test_symol_gc_1
+    assert_normal_exit('".".intern;GC.start(immediate_sweep:false);eval %[GC.start;:"."]',
+                       '',
+                       child_env: '--disable-gems')
+  end
 end

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

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