diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-10-06 09:49:53 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-10-06 09:49:53 +0000 |
commit | 72cf24c813aa788366ef4a6fc0be0491cdcaaf95 (patch) | |
tree | 2d6ed7860828db1dc997109bacd77bc0cb661cba /vm_insnhelper.c | |
parent | aa4de7328d3126288282c76a56b49a544de5e9a3 (diff) |
* method.h: remove METHOD_ENTRY_SAFE(me) and related code
because $SAFE = 3 and 4 is not available.
Now, $SAFE is not checked on method dispatch at all.
* vm_eval.c, vm_insnhelper.c, vm_method.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r-- | vm_insnhelper.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 73b1ac89a2..532fb057d1 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -2114,13 +2114,11 @@ vm_call_method0(rb_thread_t *th, rb_control_frame_t *cfp, struct rb_calling_info VM_ASSERT(callable_method_entry_p(cc->me)); if (cc->me != NULL) { - if (LIKELY(METHOD_ENTRY_VISI(cc->me) == METHOD_VISI_PUBLIC && METHOD_ENTRY_SAFE(cc->me) == 0)) { + if (LIKELY(METHOD_ENTRY_VISI(cc->me) == METHOD_VISI_PUBLIC)) { VM_ASSERT(callable_method_entry_p(cc->me)); return vm_call_method_each_type(th, cfp, calling, ci, cc, enable_fastpath); } else { - int safe; - if (!(ci->flag & VM_CALL_FCALL) && (METHOD_ENTRY_VISI(cc->me) == METHOD_VISI_PRIVATE)) { enum method_missing_reason stat = MISSING_PRIVATE; if (ci->flag & VM_CALL_VCALL) stat |= MISSING_VCALL; @@ -2139,9 +2137,6 @@ vm_call_method0(rb_thread_t *th, rb_control_frame_t *cfp, struct rb_calling_info return vm_call_method_each_type(th, cfp, calling, ci, cc, FALSE); } } - else if ((safe = METHOD_ENTRY_SAFE(cc->me)) > th->safe_level && safe > 2) { - rb_raise(rb_eSecurityError, "calling insecure method: %"PRIsVALUE, rb_id2str(ci->mid)); - } else { return vm_call_method_each_type(th, cfp, calling, ci, cc, enable_fastpath); } |