diff options
author | 卜部昌平 <shyouhei@ruby-lang.org> | 2020-06-22 11:00:31 +0900 |
---|---|---|
committer | 卜部昌平 <shyouhei@ruby-lang.org> | 2020-06-29 11:05:41 +0900 |
commit | 6e67b30503f2931d9538d439545c3b1cff51fc80 (patch) | |
tree | 2ff71b46b5280739246c0edfc03ca5d04f0066c6 /vm_eval.c | |
parent | edb1680a0549b64347518e90c6c083cb76f48521 (diff) |
method_missing: 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
@@ -820,8 +820,7 @@ method_missing(VALUE obj, ID id, int argc, const VALUE *argv, enum method_missin ec->method_missing_reason = call_status; if (id == idMethodMissing) { - missing: - raise_method_missing(ec, argc, argv, obj, call_status | MISSING_MISSING); + goto missing; } nargv = ALLOCV_N(VALUE, work, argc + 1); @@ -845,6 +844,8 @@ method_missing(VALUE obj, ID id, int argc, const VALUE *argv, enum method_missin result = rb_vm_call_kw(ec, obj, idMethodMissing, argc, argv, me, kw_splat); if (work) ALLOCV_END(work); return result; + missing: + raise_method_missing(ec, argc, argv, obj, call_status | MISSING_MISSING); } #ifndef MJIT_HEADER |