aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_objectspace.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_objectspace.rb')
-rw-r--r--test/ruby/test_objectspace.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/ruby/test_objectspace.rb b/test/ruby/test_objectspace.rb
index 24731a7a50..921de84c0b 100644
--- a/test/ruby/test_objectspace.rb
+++ b/test/ruby/test_objectspace.rb
@@ -65,4 +65,17 @@ End
END
assert_raise(ArgumentError) { ObjectSpace.define_finalizer([], Object.new) }
end
+
+ def test_each_object
+ GC.disable
+ eval('begin; 1.times{}; rescue; ensure; end')
+ arys = []
+ ObjectSpace.each_object(Array){|ary|
+ arys << ary
+ }
+ GC.enable
+ arys.each{|ary|
+ assert_equal(String, ary.inspect.class) # should not cause SEGV
+ }
+ end
end