diff options
Diffstat (limited to 'eval_jump.c')
| -rw-r--r-- | eval_jump.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/eval_jump.c b/eval_jump.c index a6139bc27b..6ee8ff4a6f 100644 --- a/eval_jump.c +++ b/eval_jump.c @@ -101,7 +101,7 @@ exec_end_procs_chain(struct end_proc_data *volatile *procs, VALUE *errp) while ((link = *procs) != 0) { *procs = link->next; endproc = *link; - xfree(link); + SIZED_FREE(link); (*endproc.func) (endproc.data); *errp = errinfo; } @@ -112,21 +112,21 @@ rb_ec_exec_end_proc(rb_execution_context_t * ec) { enum ruby_tag_type state; volatile VALUE errinfo = ec->errinfo; - - EC_PUSH_TAG(ec); - if ((state = EC_EXEC_TAG()) == TAG_NONE) { - again: - exec_end_procs_chain(&ephemeral_end_procs, &ec->errinfo); - exec_end_procs_chain(&end_procs, &ec->errinfo); - } - else { - EC_TMPPOP_TAG(); - error_handle(ec, state); - if (!NIL_P(ec->errinfo)) errinfo = ec->errinfo; - EC_REPUSH_TAG(); - goto again; + volatile bool finished = false; + + while (!finished) { + EC_PUSH_TAG(ec); + if ((state = EC_EXEC_TAG()) == TAG_NONE) { + exec_end_procs_chain(&ephemeral_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; + } } - EC_POP_TAG(); ec->errinfo = errinfo; } |
