aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_objectspace.rb
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-03 10:03:25 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-03 10:03:25 +0000
commitc4f9dd26263da640a2c9a02c478df245685e2b69 (patch)
tree842c99b744769dc41ba89082979c0d0b5d398f82 /test/ruby/test_objectspace.rb
parent17a2be29b91b971d28f4d0f2381973ee65fc13c4 (diff)
downloadruby-c4f9dd26263da640a2c9a02c478df245685e2b69.tar.gz
* 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
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