diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-03 10:03:25 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-03 10:03:25 +0000 |
commit | c4f9dd26263da640a2c9a02c478df245685e2b69 (patch) | |
tree | 842c99b744769dc41ba89082979c0d0b5d398f82 /test/ruby/test_objectspace.rb | |
parent | 17a2be29b91b971d28f4d0f2381973ee65fc13c4 (diff) | |
download | ruby-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.rb | 13 |
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 |