summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authorktsj <ktsj@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-06-23 04:52:58 +0000
committerktsj <ktsj@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-06-23 04:52:58 +0000
commit289dcb30b98688769644a9f000b577f96bd01594 (patch)
treea0c6e79f1842b0995a2013943a40ed6b2c55fca4 /vm.c
parent3b51b2fa96e05c77f61a0dacec685a98c12e7027 (diff)
vm.c: fix infinite loop
* vm.c: use EXEC_EVENT_HOOK_AND_POP_FRAME. While exception handling, if an exception is raised in hooks, need to pop current frame and raise this raised exception by hook. [ruby-dev:50582] [Bug #14865] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/vm.c b/vm.c
index e43700c..24464a1 100644
--- a/vm.c
+++ b/vm.c
@@ -1846,10 +1846,10 @@ vm_exec_handle_exception(rb_execution_context_t *ec, enum ruby_tag_type state,
while (ec->cfp->pc == 0 || ec->cfp->iseq == 0) {
if (UNLIKELY(VM_FRAME_TYPE(ec->cfp) == VM_FRAME_MAGIC_CFUNC)) {
- EXEC_EVENT_HOOK(ec, RUBY_EVENT_C_RETURN, ec->cfp->self,
- rb_vm_frame_method_entry(ec->cfp)->def->original_id,
- rb_vm_frame_method_entry(ec->cfp)->called_id,
- rb_vm_frame_method_entry(ec->cfp)->owner, Qnil);
+ EXEC_EVENT_HOOK_AND_POP_FRAME(ec, RUBY_EVENT_C_RETURN, ec->cfp->self,
+ rb_vm_frame_method_entry(ec->cfp)->def->original_id,
+ rb_vm_frame_method_entry(ec->cfp)->called_id,
+ rb_vm_frame_method_entry(ec->cfp)->owner, Qnil);
RUBY_DTRACE_CMETHOD_RETURN_HOOK(ec,
rb_vm_frame_method_entry(ec->cfp)->owner,
rb_vm_frame_method_entry(ec->cfp)->def->original_id);