mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +02:00
merge revision(s) 44535,44536: [Backport #9321]
* 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. * vm.c, eval.c, include/ruby/intern.h (rb_frame_pop): git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@46671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c669702738
commit
6ece90852b
9 changed files with 137 additions and 17 deletions
13
vm_eval.c
13
vm_eval.c
|
@ -684,7 +684,7 @@ raise_method_missing(rb_thread_t *th, int argc, const VALUE *argv, VALUE obj,
|
|||
{
|
||||
exc = make_no_method_exception(exc, format, obj, argc, argv);
|
||||
if (!(last_call_status & NOEX_MISSING)) {
|
||||
th->cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(th->cfp);
|
||||
rb_vm_pop_cfunc_frame();
|
||||
}
|
||||
rb_exc_raise(exc);
|
||||
}
|
||||
|
@ -1073,13 +1073,12 @@ rb_iterate(VALUE (* it_proc) (VALUE), VALUE data1,
|
|||
#if VMDEBUG
|
||||
printf("skipped frame: %s\n", vm_frametype_name(th->cfp));
|
||||
#endif
|
||||
if (UNLIKELY(VM_FRAME_TYPE(th->cfp) == VM_FRAME_MAGIC_CFUNC)) {
|
||||
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);
|
||||
if (VM_FRAME_TYPE(th->cfp) != VM_FRAME_MAGIC_CFUNC) {
|
||||
vm_pop_frame(th);
|
||||
}
|
||||
else { /* unlikely path */
|
||||
rb_vm_pop_cfunc_frame();
|
||||
}
|
||||
|
||||
th->cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(th->cfp);
|
||||
}
|
||||
}
|
||||
else{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue