diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-01-27 08:06:50 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-01-27 08:06:50 +0000 |
commit | d604893f2065b3797218aa0607b3c21a13c82160 (patch) | |
tree | 85c1d04b9aa6c4af63a3d56248a8a2615950f817 /vm_method.c | |
parent | 169ec127e0197bad550e9b2902f4c715d0c0b7a6 (diff) |
merge revision(s) 49221: [Backport #10731]
* vm_method.c (rb_alias): raise a NameError when creating alias to
a refined method if the original method of the refined method is
not defined. [ruby-core:67523] [Bug #10731]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@49425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_method.c')
-rw-r--r-- | vm_method.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/vm_method.c b/vm_method.c index 47223e2c22..c7f2d0826c 100644 --- a/vm_method.c +++ b/vm_method.c @@ -1221,7 +1221,9 @@ rb_alias(VALUE klass, ID name, ID def) again: orig_me = search_method(klass, def, &defined_class); - if (UNDEFINED_METHOD_ENTRY_P(orig_me)) { + if (UNDEFINED_METHOD_ENTRY_P(orig_me) || + (orig_me->def->type == VM_METHOD_TYPE_REFINED && + UNDEFINED_METHOD_ENTRY_P(orig_me->def->body.orig_me))) { if ((!RB_TYPE_P(klass, T_MODULE)) || (orig_me = search_method(rb_cObject, def, 0), UNDEFINED_METHOD_ENTRY_P(orig_me))) { |