aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-07-13 07:08:32 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-07-13 07:08:32 +0000
commit4474e843ae46757fab05ed6bf2432e2069b05685 (patch)
tree71f930605110cc9737d43a282fb465f67484328d /test/ruby
parentdc03a355bf2088c6995bbb0d63ec2c7f86f0f7d7 (diff)
downloadruby-4474e843ae46757fab05ed6bf2432e2069b05685.tar.gz
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_gc.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb
index d915ae25d7..a5fd2897a2 100644
--- a/test/ruby/test_gc.rb
+++ b/test/ruby/test_gc.rb
@@ -390,4 +390,11 @@ class TestGc < Test::Unit::TestCase
GC.enable unless disabled
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