summaryrefslogtreecommitdiff
path: root/vm_eval.c
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2020-06-22 10:59:19 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2020-06-29 11:05:41 +0900
commitedb1680a0549b64347518e90c6c083cb76f48521 (patch)
treea1e28cf5490e2d51cde7d5b2a036eff2fb8fd119 /vm_eval.c
parentf12efec2c2698fb1ea775ce3d260a35628303833 (diff)
rb_method_call_status: do not goto into a branch
I'm not necessarily against every goto in general, but jumping into a branch is definitely a bad idea. Better refactor.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3247
Diffstat (limited to 'vm_eval.c')
-rw-r--r--vm_eval.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/vm_eval.c b/vm_eval.c
index 8265091ad3..b90ff37c3a 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -632,8 +632,7 @@ rb_method_call_status(rb_execution_context_t *ec, const rb_callable_method_entry
rb_method_visibility_t visi;
if (UNDEFINED_METHOD_ENTRY_P(me)) {
- undefined:
- return scope == CALL_VCALL ? MISSING_VCALL : MISSING_NOENTRY;
+ goto undefined;
}
if (me->def->type == VM_METHOD_TYPE_REFINED) {
me = rb_resolve_refined_method_callable(Qnil, me);
@@ -667,6 +666,8 @@ rb_method_call_status(rb_execution_context_t *ec, const rb_callable_method_entry
}
return MISSING_NONE;
+ undefined:
+ return scope == CALL_VCALL ? MISSING_VCALL : MISSING_NOENTRY;
}