summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-01-08 14:40:38 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-01-08 14:40:38 +0000
commit8e8bb6c17390e949d4a51c96aa901651a679458d (patch)
tree248ba1e348257628bb63222eac2c75fc87b8edf6 /proc.c
parent479a3c4c8b4d6c612a50a6cabab04921378a6f4b (diff)
* proc.c (mnew): don't check visibility of method body if public
ZSUPER method is found. [ruby-dev:39767] * test/ruby/test_method.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26256 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/proc.c b/proc.c
index c64eb72fb1..543ee95923 100644
--- a/proc.c
+++ b/proc.c
@@ -894,6 +894,7 @@ mnew(VALUE klass, VALUE obj, ID id, VALUE mclass, int scope)
struct METHOD *data;
rb_method_entry_t *me, meb;
rb_method_definition_t *def = 0;
+ rb_method_flag_t flag = NOEX_UNDEF;
again:
me = rb_method_entry(klass, id);
@@ -921,8 +922,11 @@ mnew(VALUE klass, VALUE obj, ID id, VALUE mclass, int scope)
rb_print_undef(klass, id, 0);
}
def = me->def;
- if (scope && (me->flag & NOEX_MASK) != NOEX_PUBLIC) {
- rb_print_undef(rclass, def->original_id, (int)(me->flag & NOEX_MASK));
+ if (flag == NOEX_UNDEF) {
+ flag = me->flag;
+ if (scope && (flag & NOEX_MASK) != NOEX_PUBLIC) {
+ rb_print_undef(rclass, def->original_id, (int)(flag & NOEX_MASK));
+ }
}
if (def && def->type == VM_METHOD_TYPE_ZSUPER) {
klass = RCLASS_SUPER(me->klass);