diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-01-11 08:02:06 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-01-11 08:02:06 +0000 |
commit | 398ed65c909aad37b043c703b9a05de1d9c405bf (patch) | |
tree | 1cf7371fb476a4b2d1cb301ca862c13466367050 /bootstraptest | |
parent | 9ccc80fea01944170a36a7a93edaead66a840b39 (diff) |
[Backport #7624]
* vm_trace.c (rb_threadptr_exec_event_hooks): added a parameter to pop
a frame before JUMP_TAG() if exception occurred. This change fix bug
of Ruby 1.9. [ruby-core:51128] [ruby-trunk - Bug #7624]
* vm_core.h (EXEC_EVENT_HOOK_AND_POP_FRAME): add to use
`rb_threadptr_exec_event_hooks()' with the pop flag.
* vm.c (vm_exec): use EXEC_EVENT_HOOK_AND_POP_FRAME() while exception
handling. While exception hadnling, if an exception is raised in
hooks, need to pop current frame and raise this raised exception by
hook.
* bootstraptest/test_flow.rb: add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@38778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bootstraptest')
-rw-r--r-- | bootstraptest/test_flow.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/bootstraptest/test_flow.rb b/bootstraptest/test_flow.rb index fc93a5a46c..6b3ef749c3 100644 --- a/bootstraptest/test_flow.rb +++ b/bootstraptest/test_flow.rb @@ -562,3 +562,17 @@ assert_equal %Q{ENSURE\n}, %q{ assert_equal "false", src + %q{e.all? {false}}, bug assert_equal "true", src + %q{e.include?(:foo)}, bug end + +assert_equal('ok', %q{ + class FOO < RuntimeError; end + class BAR < RuntimeError; end + def m + raise FOO + end + set_trace_func(proc{|t,| raise BAR if t == 'return'}) + begin + m + rescue BAR + 'ok' + end +}, '[ruby-core:51128] [ruby-trunk - Bug #7624]') |