`i` should not be used here because `i` will be `alen` when
jumped here by "goto restart".
This commit is contained in:
Koichi Sasada 2020-12-04 14:39:03 +09:00
Родитель f1757a88a4
Коммит 82bbce826f
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -802,6 +802,7 @@ ractor_select(rb_execution_context_t *ec, const VALUE *rs, int alen, VALUE yield
bool interrupted = false; bool interrupted = false;
enum ractor_wait_status wait_status = 0; enum ractor_wait_status wait_status = 0;
bool yield_p = (yielded_value != Qundef) ? true : false; bool yield_p = (yielded_value != Qundef) ? true : false;
const int rs_len = alen;
struct ractor_select_action { struct ractor_select_action {
enum ractor_select_action_type { enum ractor_select_action_type {
@ -840,8 +841,8 @@ ractor_select(rb_execution_context_t *ec, const VALUE *rs, int alen, VALUE yield
restart: restart:
if (yield_p) { if (yield_p) {
actions[i].type = ractor_select_action_yield; actions[rs_len].type = ractor_select_action_yield;
actions[i].v = Qundef; actions[rs_len].v = Qundef;
wait_status |= wait_yielding; wait_status |= wait_yielding;
alen++; alen++;