Project

General

Profile

Bug #10470 ยป fix_attr_accessor_event.diff

joker1007 (Tomohiro Hashidate), 11/03/2014 07:24 AM

View differences:

vm_eval.c
goto success;
case VM_METHOD_TYPE_ATTRSET:
rb_check_arity(ci->argc, 1, 1);
EXEC_EVENT_HOOK(th, RUBY_EVENT_C_CALL, ci->recv, ci->mid, ci->defined_class, Qnil);
ret = rb_ivar_set(ci->recv, ci->me->def->body.attr.id, argv[0]);
EXEC_EVENT_HOOK(th, RUBY_EVENT_C_RETURN, ci->recv, ci->mid, ci->defined_class, ret);
goto success;
case VM_METHOD_TYPE_IVAR:
rb_check_arity(ci->argc, 0, 0);
EXEC_EVENT_HOOK(th, RUBY_EVENT_C_CALL, ci->recv, ci->mid, ci->defined_class, Qnil);
ret = rb_attr_get(ci->recv, ci->me->def->body.attr.id);
EXEC_EVENT_HOOK(th, RUBY_EVENT_C_RETURN, ci->recv, ci->mid, ci->defined_class, ret);
goto success;
case VM_METHOD_TYPE_BMETHOD:
ret = vm_call_bmethod_body(th, ci, argv);
vm_insnhelper.c
static VALUE
vm_call_ivar(rb_thread_t *th, rb_control_frame_t *cfp, rb_call_info_t *ci)
{
const rb_method_entry_t *me = ci->me;
EXEC_EVENT_HOOK(th, RUBY_EVENT_C_CALL, ci->recv, me->called_id, me->klass, Qnil);
VALUE val = vm_getivar(ci->recv, ci->me->def->body.attr.id, 0, ci, 1);
cfp->sp -= 1;
EXEC_EVENT_HOOK(th, RUBY_EVENT_C_RETURN, ci->recv, me->called_id, me->klass, val);
return val;
}
static VALUE
vm_call_attrset(rb_thread_t *th, rb_control_frame_t *cfp, rb_call_info_t *ci)
{
const rb_method_entry_t *me = ci->me;
EXEC_EVENT_HOOK(th, RUBY_EVENT_C_CALL, ci->recv, me->called_id, me->klass, Qnil);
VALUE val = vm_setivar(ci->recv, ci->me->def->body.attr.id, *(cfp->sp - 1), 0, ci, 1);
cfp->sp -= 2;
EXEC_EVENT_HOOK(th, RUBY_EVENT_C_RETURN, ci->recv, me->called_id, me->klass, val);
return val;
}
    (1-1/1)