From 2dca886a0702e51ff06926bd94c36e6983cc450d Mon Sep 17 00:00:00 2001 From: naruse Date: Wed, 23 Apr 2014 20:59:03 +0000 Subject: [PATCH] * parse.y (dsym_node_gen): like r45492, call rb_gc_resurrect(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ parse.y | 3 +++ test/ruby/test_symbol.rb | 6 ++++++ 3 files changed, 13 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2b2b120b0e..b1716cb6dd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Thu Apr 24 05:50:13 2014 NARUSE, Yui + + * parse.y (dsym_node_gen): like r45492, call rb_gc_resurrect(). + Wed Apr 23 20:36:22 2014 Tanaka Akira * ext/etc/extconf.rb: Build ext/etc unconditionally. diff --git a/parse.y b/parse.y index 726f89130b..aa52183ea7 100644 --- a/parse.y +++ b/parse.y @@ -9571,6 +9571,9 @@ dsym_node_gen(struct parser_params *parser, NODE *node) 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: diff --git a/test/ruby/test_symbol.rb b/test/ruby/test_symbol.rb index 70358ea1bc..f24bb81583 100644 --- a/test/ruby/test_symbol.rb +++ b/test/ruby/test_symbol.rb @@ -221,4 +221,10 @@ class TestSymbol < Test::Unit::TestCase 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