From 6cde2d359a76e0c342f5f3ebe85578556ee74c1f Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 8 Mar 2016 15:29:48 +0000 Subject: vm_method.c: fix aliased original name * vm_method.c (rb_alias): the original name should be properly available method_added method, set the name before calling the hook. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_method.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'vm_method.c') diff --git a/vm_method.c b/vm_method.c index bbe7bebaa9..2d3e78c303 100644 --- a/vm_method.c +++ b/vm_method.c @@ -1552,10 +1552,10 @@ rb_alias(VALUE klass, ID alias_name, ID original_name) if (visi == METHOD_VISI_UNDEF) visi = METHOD_ENTRY_VISI(orig_me); if (orig_me->defined_class == 0) { - rb_method_entry_t *alias_me; - - alias_me = rb_add_method(target_klass, alias_name, VM_METHOD_TYPE_ALIAS, (void *)rb_method_entry_clone(orig_me), visi); - alias_me->def->original_id = orig_me->called_id; + rb_method_entry_make(target_klass, alias_name, target_klass, visi, + VM_METHOD_TYPE_ALIAS, NULL, orig_me->called_id, + (void *)rb_method_entry_clone(orig_me)); + method_added(target_klass, alias_name); } else { rb_method_entry_t *alias_me; -- cgit v1.2.3