parrotcode: Exceptions | |
Contents | C |
src/exceptions.c - Exceptions
Define the internal interpreter exceptions.
enum_class
of the Exception isn't fixed.internal_exception
Parrot_exit
to invoke exit handlers and exit the process with the given exitcode.
No error handlers are used,
so it is not possible for Parrot bytecode to intercept a fatal error (cf.
real_exception
).
Furthermore,
no stack unwinding is done,
so the exit handlers run in the current dynamic environment.do_panic
push_exception
Parrot_push_action
Parrot_push_mark
Parrot_pop_mark
find_exception_handler
exception
.pop_exception
new_c_exception_handler
push_new_c_exception_handler
throw_exception
rethrow_exception
rethrow_c_exception
new_c_exception
.dest2offset
create_exception
handle_exception
new_internal_exception
free_internal_exception
do_exception
longjmp
in front of the runloop,
which calls handle_exception()
,
returning the handler address where execution then resumes. the_exception->error = error;
the_exception->severity = severity;
the_exception->msg = NULL;
the_exception->resume = NULL;
longjmp(the_exception->destination, 1);
}
real_exception
ret_addr
is the address from which to resume, if some handler decides that is appropriate, or zero to make the error non-resumable. exitcode
is a exception_type_enum
value.internal_exception()
, which signals fatal errors, and throw_exception
, which calls the handler.Parrot_init_exceptions
Parrot_confess
include/parrot/exceptions.h.
|