summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-09 10:12:59 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-09 10:12:59 +0000
commitc2e72fb34302e444f6cc4c6477877e36902a7035 (patch)
tree4b927e0247f55ab43a1b6cbeff76ae4b9c2ddc10 /vm.c
parent8abc55bc54480451fe43a1cf79351fde0b14816d (diff)
* vm.c (rb_vm_pop_cfunc_frame): added. It cares c_return event.
The patch base by drkaes (Stefan Kaes). [Bug #9321] * variable.c (rb_mod_const_missing): use rb_vm_pop_cfunc_frame() instead of rb_frame_pop(). * vm_eval.c (raise_method_missing): ditto. * vm_eval.c (rb_iterate): ditto. * internal.h (rb_vm_pop_cfunc_frame): add decl. * test/ruby/test_settracefunc.rb: add tests. provided by drkaes (Stefan Kaes). * vm.c, eval.c, include/ruby/intern.h (rb_frame_pop): move definition of rb_frame_pop() and deprecate it. It doesn't care about `return' events. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/vm.c b/vm.c
index d1b63796f6..6fae9238d5 100644
--- a/vm.c
+++ b/vm.c
@@ -277,6 +277,24 @@ vm_get_ruby_level_caller_cfp(rb_thread_t *th, rb_control_frame_t *cfp)
return 0;
}
+void
+rb_vm_pop_cfunc_frame(void)
+{
+ rb_thread_t *th = GET_THREAD();
+ const rb_method_entry_t *me = th->cfp->me;
+ EXEC_EVENT_HOOK(th, RUBY_EVENT_C_RETURN, th->cfp->self, me->called_id, me->klass, Qnil);
+ RUBY_DTRACE_CMETHOD_RETURN_HOOK(th, me->klass, me->called_id);
+ vm_pop_frame(th);
+}
+
+/* obsolete */
+void
+rb_frame_pop(void)
+{
+ rb_thread_t *th = GET_THREAD();
+ vm_pop_frame(th);
+}
+
/* at exit */
void