diff --git a/ChangeLog b/ChangeLog index 851372d96e..84f596e78d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +Tue Aug 16 13:36:00 2016 Koichi Sasada + + * gc.c (gc_mark_roots): should mark the VM object itself to mark + singleton class of the VM object. + Before this patch, we only set mark bit for the VM object and + invoke mark function separately. + [Bug #12583] + + * test/ruby/test_gc.rb: add a test. + Tue Aug 16 13:29:25 2016 NAKAMURA Usaku * lib/rubygems/package.rb: Fixed potential perms issue unpacking of diff --git a/gc.c b/gc.c index 5ebb9376d9..51872f26dd 100644 --- a/gc.c +++ b/gc.c @@ -4389,7 +4389,7 @@ gc_mark_roots(rb_objspace_t *objspace, const char **categoryp) MARK_CHECKPOINT("vm"); SET_STACK_END; rb_vm_mark(th->vm); - if (th->vm->self) gc_mark_set(objspace, th->vm->self); + if (th->vm->self) gc_mark(objspace, th->vm->self); MARK_CHECKPOINT("finalizers"); mark_tbl(objspace, finalizer_table); diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb index 7ac67c4757..0dad81671b 100644 --- a/test/ruby/test_gc.rb +++ b/test/ruby/test_gc.rb @@ -377,4 +377,11 @@ class TestGc < Test::Unit::TestCase C.new end; end + + def test_vm_object + assert_normal_exit <<-'end', '[Bug #12583]' + ObjectSpace.each_object{|o| o.singleton_class rescue 0} + ObjectSpace.each_object{|o| case o when Module then o.instance_methods end} + end + end end diff --git a/version.h b/version.h index d6e8e3e8b7..dab4a96957 100644 --- a/version.h +++ b/version.h @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.2.6" #define RUBY_RELEASE_DATE "2016-08-16" -#define RUBY_PATCHLEVEL 349 +#define RUBY_PATCHLEVEL 350 #define RUBY_RELEASE_YEAR 2016 #define RUBY_RELEASE_MONTH 8