aboutsummaryrefslogtreecommitdiffstats
path: root/vm_method.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-21 05:00:53 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-21 05:00:53 +0000
commitad717fa7e657703205c44df1b00f7d7d4a60d8ca (patch)
tree3daaa727391dacfec0ee28be46405645b16fa81c /vm_method.c
parent5647b2cd881bc45e531a71d51c1b9f9bbee9ce7f (diff)
downloadruby-ad717fa7e657703205c44df1b00f7d7d4a60d8ca.tar.gz
* vm_method.c (rb_method_boundp): revert r28543, r28564.
They may be merged in Ruby 2.0. [ruby-core:31217] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_method.c')
-rw-r--r--vm_method.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/vm_method.c b/vm_method.c
index aa5db73643..50f0b12e5a 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -565,19 +565,18 @@ rb_method_boundp(VALUE klass, ID id, int ex)
{
rb_method_entry_t *me = rb_method_entry(klass, id);
- if (!me) return 0;
- if (ex & ~NOEX_RESPONDS) { /* pub */
- if (me->flag & NOEX_PRIVATE) return 0;
- if (ex & NOEX_RESPONDS) {
- if (me->flag & NOEX_PROTECTED) return 0;
+ if (me != 0) {
+ if ((ex & ~NOEX_RESPONDS) && (me->flag & NOEX_PRIVATE)) {
+ return FALSE;
}
+ if (!me->def) return 0;
+ if (me->def->type == VM_METHOD_TYPE_NOTIMPLEMENTED) {
+ if (ex & NOEX_RESPONDS) return 2;
+ return 0;
+ }
+ return 1;
}
- if (!me->def) return 0;
- if (me->def->type == VM_METHOD_TYPE_NOTIMPLEMENTED) {
- if (ex & NOEX_RESPONDS) return 2;
- return 0;
- }
- return 1;
+ return 0;
}
void