diff options
author | 卜部昌平 <shyouhei@ruby-lang.org> | 2020-06-22 10:59:19 +0900 |
---|---|---|
committer | 卜部昌平 <shyouhei@ruby-lang.org> | 2020-06-29 11:05:41 +0900 |
commit | edb1680a0549b64347518e90c6c083cb76f48521 (patch) | |
tree | a1e28cf5490e2d51cde7d5b2a036eff2fb8fd119 /vm_eval.c | |
parent | f12efec2c2698fb1ea775ce3d260a35628303833 (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.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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; } |