With ASAN `EC_REPUSH_TAG` doesn't work

With ASAN, `EC_TMPPOP_TAG`/`EC_REPUSH_TAG` doesn't work
so rewrite it without them. They are used for the performance,
but here calling stacked `END{}` and not so performance critical.
This commit is contained in:
Koichi Sasada 2024-06-24 15:59:38 +09:00
Родитель afd42e4db7
Коммит 92f2cf1bf9
1 изменённых файлов: 13 добавлений и 13 удалений

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

@ -112,21 +112,21 @@ rb_ec_exec_end_proc(rb_execution_context_t * ec)
{ {
enum ruby_tag_type state; enum ruby_tag_type state;
volatile VALUE errinfo = ec->errinfo; volatile VALUE errinfo = ec->errinfo;
volatile bool finished = false;
EC_PUSH_TAG(ec); while (!finished) {
if ((state = EC_EXEC_TAG()) == TAG_NONE) { EC_PUSH_TAG(ec);
again: if ((state = EC_EXEC_TAG()) == TAG_NONE) {
exec_end_procs_chain(&ephemeral_end_procs, &ec->errinfo); exec_end_procs_chain(&ephemeral_end_procs, &ec->errinfo);
exec_end_procs_chain(&end_procs, &ec->errinfo); exec_end_procs_chain(&end_procs, &ec->errinfo);
finished = true;
}
EC_POP_TAG();
if (state != TAG_NONE) {
error_handle(ec, ec->errinfo, state);
if (!NIL_P(ec->errinfo)) errinfo = ec->errinfo;
}
} }
else {
EC_TMPPOP_TAG();
error_handle(ec, ec->errinfo, state);
if (!NIL_P(ec->errinfo)) errinfo = ec->errinfo;
EC_REPUSH_TAG();
goto again;
}
EC_POP_TAG();
ec->errinfo = errinfo; ec->errinfo = errinfo;
} }