mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
parent
3ff53c8e04
commit
5b21e94beb
Notes:
git
2022-07-22 01:42:33 +09:00
158 changed files with 38285 additions and 37251 deletions
36
eval_jump.c
36
eval_jump.c
|
@ -40,7 +40,7 @@ rb_f_at_exit(VALUE _)
|
|||
VALUE proc;
|
||||
|
||||
if (!rb_block_given_p()) {
|
||||
rb_raise(rb_eArgError, "called without a block");
|
||||
rb_raise(rb_eArgError, "called without a block");
|
||||
}
|
||||
proc = rb_block_proc();
|
||||
rb_set_end_proc(rb_call_end_proc, proc);
|
||||
|
@ -63,10 +63,10 @@ rb_set_end_proc(void (*func)(VALUE), VALUE data)
|
|||
rb_thread_t *th = GET_THREAD();
|
||||
|
||||
if (th->top_wrapper) {
|
||||
list = &ephemeral_end_procs;
|
||||
list = &ephemeral_end_procs;
|
||||
}
|
||||
else {
|
||||
list = &end_procs;
|
||||
list = &end_procs;
|
||||
}
|
||||
link->next = *list;
|
||||
link->func = func;
|
||||
|
@ -81,13 +81,13 @@ rb_mark_end_proc(void)
|
|||
|
||||
link = end_procs;
|
||||
while (link) {
|
||||
rb_gc_mark(link->data);
|
||||
link = link->next;
|
||||
rb_gc_mark(link->data);
|
||||
link = link->next;
|
||||
}
|
||||
link = ephemeral_end_procs;
|
||||
while (link) {
|
||||
rb_gc_mark(link->data);
|
||||
link = link->next;
|
||||
rb_gc_mark(link->data);
|
||||
link = link->next;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -99,11 +99,11 @@ exec_end_procs_chain(struct end_proc_data *volatile *procs, VALUE *errp)
|
|||
VALUE errinfo = *errp;
|
||||
|
||||
while ((link = *procs) != 0) {
|
||||
*procs = link->next;
|
||||
endproc = *link;
|
||||
xfree(link);
|
||||
(*endproc.func) (endproc.data);
|
||||
*errp = errinfo;
|
||||
*procs = link->next;
|
||||
endproc = *link;
|
||||
xfree(link);
|
||||
(*endproc.func) (endproc.data);
|
||||
*errp = errinfo;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -116,15 +116,15 @@ rb_ec_exec_end_proc(rb_execution_context_t * ec)
|
|||
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);
|
||||
exec_end_procs_chain(&ephemeral_end_procs, &ec->errinfo);
|
||||
exec_end_procs_chain(&end_procs, &ec->errinfo);
|
||||
}
|
||||
else {
|
||||
EC_TMPPOP_TAG();
|
||||
EC_TMPPOP_TAG();
|
||||
error_handle(ec, state);
|
||||
if (!NIL_P(ec->errinfo)) errinfo = ec->errinfo;
|
||||
EC_REPUSH_TAG();
|
||||
goto again;
|
||||
if (!NIL_P(ec->errinfo)) errinfo = ec->errinfo;
|
||||
EC_REPUSH_TAG();
|
||||
goto again;
|
||||
}
|
||||
EC_POP_TAG();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue