diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-02-28 04:41:38 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-02-28 04:41:38 +0000 |
commit | 4d9f5482aea747e614a8d78b5e8ec114b023a768 (patch) | |
tree | 3075620060c592076e2df80b21949e7e1e0ed8cd /vm_insnhelper.c | |
parent | 74e5e61849e6062554adbc6887ce435826bcaef2 (diff) | |
download | ruby-4d9f5482aea747e614a8d78b5e8ec114b023a768.tar.gz |
NoMethodError#private_call?
* error.c (nometh_err_initialize): add private_call? parameter.
* error.c (nometh_err_private_call_p): add private_call? method,
to tell if the exception raised in private form FCALL or VCALL.
[Feature #12043]
* vm_eval.c (make_no_method_exception): append private_call?
argument.
* vm_insnhelper.c (ci_missing_reason): copy FCALL flag.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53961 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 022a64df12..39ca48a578 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -1782,6 +1782,7 @@ ci_missing_reason(const struct rb_call_info *ci) { enum method_missing_reason stat = MISSING_NOENTRY; if (ci->flag & VM_CALL_VCALL) stat |= MISSING_VCALL; + if (ci->flag & VM_CALL_FCALL) stat |= MISSING_FCALL; if (ci->flag & VM_CALL_SUPER) stat |= MISSING_SUPER; return stat; } @@ -1823,7 +1824,8 @@ vm_call_opt_send(rb_thread_t *th, rb_control_frame_t *reg_cfp, struct rb_calling if (!(ci->mid = rb_check_id(&sym))) { if (rb_method_basic_definition_p(CLASS_OF(calling->recv), idMethodMissing)) { VALUE exc = make_no_method_exception(rb_eNoMethodError, 0, calling->recv, - rb_long2int(calling->argc), &TOPN(i)); + rb_long2int(calling->argc), &TOPN(i), + ci->flag & (VM_CALL_FCALL|VM_CALL_VCALL)); rb_exc_raise(exc); } TOPN(i) = rb_str_intern(sym); |