1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ktsj 2014-04-29 01:25:36 +00:00
parent 7973883c3a
commit 0f51db6a1e
3 changed files with 14 additions and 2 deletions

View file

@ -1,3 +1,7 @@
Tue Apr 29 10:21:38 2014 Kazuki Tsujimoto <kazuki@callcc.net>
* parse.y (symbols_i): like r45492, call rb_gc_resurrect().
Tue Apr 29 04:29:05 2014 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
* file.c (HAVE_STRUCT_STATFS_T_F_FSTYPENAME): Add new macro for

View file

@ -10908,9 +10908,13 @@ rb_make_internal_id(void)
}
static int
symbols_i(VALUE sym, ID value, VALUE ary)
symbols_i(VALUE key, ID value, VALUE ary)
{
rb_ary_push(ary, ID2SYM(value));
VALUE sym = ID2SYM(value);
if (ID_DYNAMIC_SYM_P(value)) {
rb_gc_resurrect(sym);
}
rb_ary_push(ary, sym);
return ST_CONTINUE;
}

View file

@ -232,5 +232,9 @@ class TestSymbol < Test::Unit::TestCase
assert_normal_exit('".".intern;GC.start(immediate_sweep:false);eval %[GC.start;%i"."]',
'',
child_env: '--disable-gems')
assert_normal_exit('tap{".".intern};GC.start(immediate_sweep:false);' +
'eval %[syms=Symbol.all_symbols;GC.start;syms.each(&:to_sym)]',
'',
child_env: '--disable-gems')
end
end