diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-02 19:14:24 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-02 19:14:24 +0000 |
commit | f7894e422a935d975f7fc4130b73fefba16a9433 (patch) | |
tree | 90ef867c4dee346545b93989aba1978ed1c9a7e2 /bootstraptest/test_flow.rb | |
parent | 0446be770e48de54a32e7f383f064e734473785a (diff) |
vm.c: rewrite all catch points
* vm.c (rb_vm_rewrite_ep_in_errinfo): rewrite all catch points in
errinfo, not only the topmost frame. based on the patch by
ktsj (Kazuki Tsujimoto) in [ruby-dev:45656]. [Bug #6460]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bootstraptest/test_flow.rb')
-rw-r--r-- | bootstraptest/test_flow.rb | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/bootstraptest/test_flow.rb b/bootstraptest/test_flow.rb index d40d814fbc..0390062a24 100644 --- a/bootstraptest/test_flow.rb +++ b/bootstraptest/test_flow.rb @@ -543,9 +543,49 @@ assert_equal %Q{ENSURE\n}, %q{ end end e = Bug5234.new +}], + ['[ruby-dev:45656]', %q{ + class Bug6460 + include Enumerable + def each + begin + yield :foo + ensure + 1.times { Proc.new } + end + end + end + e = Bug6460.new }]].each do |bug, src| assert_equal "foo", src + %q{e.detect {true}}, bug assert_equal "true", src + %q{e.any? {true}}, bug assert_equal "false", src + %q{e.all? {false}}, bug assert_equal "true", src + %q{e.include?(:foo)}, bug end + +assert_equal "foo", %q{ + class Bug6460 + def m1 + m2 {|e| + return e + } + end + + def m2 + begin + yield :foo + ensure + begin + begin + yield :foo + ensure + Proc.new + raise '' + end + rescue + end + end + end + end + Bug6460.new.m1 +}, '[ruby-dev:46372]' |