diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-26 09:30:08 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-26 09:30:08 +0000 |
commit | 00d61f1fe52b7637e93dde5a7c55cb2138a88405 (patch) | |
tree | 2d17d3b8173bd39996f1ad4688420c5a489298a6 /vm_insnhelper.c | |
parent | 34df0e5c9f82a604e3448757e580bd7a75169596 (diff) | |
download | ruby-00d61f1fe52b7637e93dde5a7c55cb2138a88405.tar.gz |
* vm_insnhelper.c (vm_call_method): __send__ can call protected
methods. [ruby-core:24500]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24280 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r-- | vm_insnhelper.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 97ba1baba6..4e7ce63f84 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -496,6 +496,7 @@ vm_call_method(rb_thread_t *th, rb_control_frame_t *cfp, ID id, const rb_method_entry_t *me, VALUE recv) { VALUE val; + int opt_send = 0; start_method_dispatch: @@ -567,6 +568,7 @@ vm_call_method(rb_thread_t *th, rb_control_frame_t *cfp, num -= 1; DEC_SP(1); flag |= VM_CALL_FCALL_BIT; + opt_send = 1; goto start_method_dispatch; } @@ -605,7 +607,7 @@ vm_call_method(rb_thread_t *th, rb_control_frame_t *cfp, } val = vm_method_missing(th, id, recv, num, blockptr, stat); } - else if ((me->flag & NOEX_MASK) & NOEX_PROTECTED) { + else if (!opt_send && (me->flag & NOEX_MASK) & NOEX_PROTECTED) { VALUE defined_class = me->klass; if (TYPE(defined_class) == T_ICLASS) { |