summaryrefslogtreecommitdiff
path: root/vm_method.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-12 08:18:10 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-12 08:18:10 +0000
commita11e25432bf68d87528537b0717f6f13519622eb (patch)
tree900f68e4f28b4eb59dcc050848788825885364d9 /vm_method.c
parent1abd51ad910ded964b5e6db984517974838f3850 (diff)
method.h: UNDEFINED_REFINED_METHOD_P
* method.h (UNDEFINED_REFINED_METHOD_P): macro to tell if refined original method is defined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_method.c')
-rw-r--r--vm_method.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/vm_method.c b/vm_method.c
index a406612..2934754 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -831,8 +831,7 @@ rb_export_method(VALUE klass, ID name, rb_method_flag_t noex)
}
if (UNDEFINED_METHOD_ENTRY_P(me) ||
- (me->def->type == VM_METHOD_TYPE_REFINED &&
- UNDEFINED_METHOD_ENTRY_P(me->def->body.orig_me))) {
+ UNDEFINED_REFINED_METHOD_P(me->def)) {
rb_print_undef(klass, name, 0);
}
@@ -931,8 +930,7 @@ rb_undef(VALUE klass, ID id)
me = search_method(klass, id, 0);
if (UNDEFINED_METHOD_ENTRY_P(me) ||
- (me->def->type == VM_METHOD_TYPE_REFINED &&
- UNDEFINED_METHOD_ENTRY_P(me->def->body.orig_me))) {
+ UNDEFINED_REFINED_METHOD_P(me->def)) {
const char *s0 = " class";
VALUE c = klass;
@@ -1279,8 +1277,7 @@ rb_alias(VALUE klass, ID name, ID def)
orig_me = search_method(klass, def, &defined_class);
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))) {
+ UNDEFINED_REFINED_METHOD_P(orig_me->def)) {
if ((!RB_TYPE_P(klass, T_MODULE)) ||
(orig_me = search_method(rb_cObject, def, 0),
UNDEFINED_METHOD_ENTRY_P(orig_me))) {