6#include "eval_intern.h"
11rb_call_end_proc(
VALUE data)
43 rb_raise(rb_eArgError,
"called without a block");
46 rb_set_end_proc(rb_call_end_proc, proc);
63 rb_thread_t *th = GET_THREAD();
65 if (th->top_wrapper) {
66 list = &ephemeral_end_procs;
84 rb_gc_mark(link->data);
87 link = ephemeral_end_procs;
89 rb_gc_mark(link->data);
99 VALUE errinfo = *errp;
101 while ((link = *procs) != 0) {
105 (*endproc.func) (endproc.data);
111rb_ec_exec_end_proc(rb_execution_context_t * ec)
113 enum ruby_tag_type state;
114 volatile VALUE errinfo = ec->errinfo;
116 VALUE shown_causes = 0;
117 volatile bool finished =
false;
121 if ((state = EC_EXEC_TAG()) == TAG_NONE) {
122 exec_end_procs_chain(&ephemeral_end_procs, &ec->errinfo);
123 exec_end_procs_chain(&end_procs, &ec->errinfo);
127 if (state != TAG_NONE) {
128 VALUE err = ec->errinfo;
129 add_shown_cause(errinfo, &shown_causes);
130 error_handle_with_shown_causes(ec, err, state, &shown_causes);
131 if (!
NIL_P(err)) errinfo = err;
135 ec->errinfo = errinfo;
#define rb_define_global_function(mid, func, arity)
Defines rb_mKernel #mid.
int rb_block_given_p(void)
Determines if the current method is given a block.
#define ALLOC
Old name of RB_ALLOC.
#define xfree
Old name of ruby_xfree.
#define NIL_P
Old name of RB_NIL_P.
VALUE rb_ary_new(void)
Allocates a new, empty array.
VALUE rb_proc_call(VALUE recv, VALUE args)
Evaluates the passed proc with the passed arguments.
VALUE rb_block_proc(void)
Constructs a Proc object from implicitly passed components.
#define _(args)
This was a transition path from K&R to ANSI.
uintptr_t VALUE
Type that represents a Ruby object.