From edb1680a0549b64347518e90c6c083cb76f48521 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?= Date: Mon, 22 Jun 2020 10:59:19 +0900 Subject: [PATCH] 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. --- vm_eval.c | 5 +++-- 1 file 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; }