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 289c77a4ec..a406612ed9 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -1278,7 +1278,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))) {