diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-08 15:29:48 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-08 15:29:48 +0000 |
commit | 6cde2d359a76e0c342f5f3ebe85578556ee74c1f (patch) | |
tree | a59408baf2d932d10a78f8da295f83ef40503575 /vm_method.c | |
parent | 3c4ade20195ed345c06852dedb20d106000cbe90 (diff) |
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
Diffstat (limited to 'vm_method.c')
-rw-r--r-- | vm_method.c | 8 |
1 files changed, 4 insertions, 4 deletions
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; |