diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-16 08:44:23 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-16 08:44:23 +0000 |
commit | b5dd85f049ce4dc7249711ac9ee5c7a90520d4f1 (patch) | |
tree | 2a6ef8faa2b573d0540578bea03216918f45a894 /vm_method.c | |
parent | 53163f8138e1e0d1c0f91351a8cfe8749151d56e (diff) |
* vm_method.c (rb_alias): fix a case which try non-existing method alias.
* test/ruby/test_alias.rb: add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_method.c')
-rw-r--r-- | vm_method.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/vm_method.c b/vm_method.c index b85351a671..4b747e9d52 100644 --- a/vm_method.c +++ b/vm_method.c @@ -814,10 +814,9 @@ rb_alias(VALUE klass, ID name, ID def) if (!orig_me || orig_me->type == VM_METHOD_TYPE_UNDEF) { if (TYPE(klass) == T_MODULE) { orig_me = search_method(rb_cObject, def); - - if (!orig_me || !orig_me->type == VM_METHOD_TYPE_UNDEF) { - rb_print_undef(klass, def, 0); - } + } + if (!orig_me || !orig_me->type == VM_METHOD_TYPE_UNDEF) { + rb_print_undef(klass, def, 0); } } if (FL_TEST(klass, FL_SINGLETON)) { |