summaryrefslogtreecommitdiff
path: root/vm_method.c
diff options
context:
space:
mode:
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 0258f36d99..47223e2c22 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -771,7 +771,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);
}