Project

General

Profile

Bug #11182 ยป alias_affected_by_original_refinement.diff

shugo (Shugo Maeda), 05/28/2015 07:54 AM

View differences:

vm_insnhelper.c
1798 1798
		if (NIL_P(refinement)) {
1799 1799
		    goto no_refinement_dispatch;
1800 1800
		}
1801
		me = rb_method_entry(refinement, ci->mid, &defined_class);
1801
		me = rb_method_entry(refinement, ci->me->def->original_id,
1802
				     &defined_class);
1802 1803
		if (me) {
1803 1804
		    if (ci->call == vm_call_super_method) {
1804 1805
			rb_control_frame_t *top_cfp = current_method_entry(th, cfp);
vm_method.c
220 220
{
221 221
    rb_method_definition_t *new_def;
222 222

  
223
    if (me->def && me->def->type == VM_METHOD_TYPE_REFINED)
223
    if (me->def && me->def->type == VM_METHOD_TYPE_REFINED &&
224
	me->called_id == me->def->original_id)
224 225
	return;
225 226

  
226 227
    new_def = ALLOC(rb_method_definition_t);
......
1303 1304

  
1304 1305
  again:
1305 1306
    orig_me = search_method(klass, def, &defined_class);
1306
    if (orig_me && orig_me->def->type == VM_METHOD_TYPE_REFINED) {
1307
	orig_me = rb_resolve_refined_method(Qnil, orig_me, &defined_class);
1308
    }
1309 1307

  
1310 1308
    if (UNDEFINED_METHOD_ENTRY_P(orig_me) ||
1311 1309
	UNDEFINED_REFINED_METHOD_P(orig_me->def)) {