From c4f9dd26263da640a2c9a02c478df245685e2b69 Mon Sep 17 00:00:00 2001 From: ko1 Date: Mon, 3 Dec 2012 10:03:25 +0000 Subject: * iseq.h: iseq_catch_table_entry::catch_type should be Fixnum because they are pushed into Array in a compiler. [Bug #7502] * test/ruby/test_objectspace.rb: add a test of this issue. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_objectspace.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/ruby/test_objectspace.rb') 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 -- cgit v1.2.1