summaryrefslogtreecommitdiff
path: root/vm_method.c
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-28 17:28:57 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-28 17:28:57 +0000
commitc839def7cc34f858777b15d2d84cb45b585d9699 (patch)
treefb48ba0312b50723d9e894a7f32113996f6fa240 /vm_method.c
parent8e73157dd03c5dd4848da16edbb59c44b07b2d4c (diff)
merge revision(s) r49182,r49183: [Backport #10706]
vm_method.c: fix change refined new method visibility * vm_method.c (rb_export_method): bail out if the original method is undefined when the method is refined. [ruby-core:67387] [Bug #10706] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@49786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_method.c')
-rw-r--r--vm_method.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/vm_method.c b/vm_method.c
index 2270359029..08946b9862 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -811,7 +811,9 @@ rb_export_method(VALUE klass, ID name, rb_method_flag_t noex)
me = search_method(rb_cObject, name, &defined_class);
}
- if (UNDEFINED_METHOD_ENTRY_P(me)) {
+ if (UNDEFINED_METHOD_ENTRY_P(me) ||
+ (me->def->type == VM_METHOD_TYPE_REFINED &&
+ UNDEFINED_METHOD_ENTRY_P(me->def->body.orig_me))) {
rb_print_undef(klass, name, 0);
}