exec_recursive: 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.
This commit is contained in:
parent
08fc718e8c
commit
8fc8912109
Notes:
git
2020-06-29 11:06:42 +09:00
10
thread.c
10
thread.c
@ -5162,10 +5162,7 @@ exec_recursive(VALUE (*func) (VALUE, VALUE, int), VALUE obj, VALUE pairid, VALUE
|
||||
}
|
||||
EC_POP_TAG();
|
||||
if (!recursive_pop(p.list, p.obj, p.pairid)) {
|
||||
invalid:
|
||||
rb_raise(rb_eTypeError, "invalid inspect_tbl pair_list "
|
||||
"for %+"PRIsVALUE" in %+"PRIsVALUE,
|
||||
sym, rb_thread_current());
|
||||
goto invalid;
|
||||
}
|
||||
if (state != TAG_NONE) EC_JUMP_TAG(GET_EC(), state);
|
||||
result = ret;
|
||||
@ -5173,6 +5170,11 @@ exec_recursive(VALUE (*func) (VALUE, VALUE, int), VALUE obj, VALUE pairid, VALUE
|
||||
}
|
||||
*(volatile struct exec_recursive_params *)&p;
|
||||
return result;
|
||||
|
||||
invalid:
|
||||
rb_raise(rb_eTypeError, "invalid inspect_tbl pair_list "
|
||||
"for %+"PRIsVALUE" in %+"PRIsVALUE,
|
||||
sym, rb_thread_current());
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user