1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* proc.c (proc_new): force to rewrite errinfo when calling Proc.new in ensure.

[Bug #5234] [ruby-core:39125]
  This code will be removed after changing throw mechanism (see r33064).

* vm.c (rb_vm_rewrite_dfp_in_errinfo): new function.

* vm.c (vm_make_env_each): changed accordingly.

* vm_core.h: ditto.

* bootstraptest/test_flow.rb: add tests for above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33096 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ktsj 2011-08-27 09:59:48 +00:00
parent 7412263eba
commit a09e7139a3
5 changed files with 52 additions and 16 deletions

View file

@ -530,6 +530,19 @@ assert_equal %Q{ENSURE\n}, %q{
end
end
e = Bug2729.new
}],
['[ruby-core:39125]', %q{
class Bug5234
include Enumerable
def each
begin
yield :foo
ensure
proc
end
end
end
e = Bug5234.new
}]].each do |bug, src|
assert_equal "foo", src + %q{e.detect {true}}, bug
assert_equal "true", src + %q{e.any? {true}}, bug