| parrotcode: Exceptions | |
| Contents | C | 

src/exceptions.c - Exceptions

Define the internal interpreter exceptions.
enum_class of the Exception isn't fixed.
void internal_exceptionParrot_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.void do_panicvoid push_exceptionstatic void run_cleanup_actionParrot_push_action.void Parrot_push_actionvoid Parrot_push_markvoid Parrot_pop_markstatic PMC *find_exception_handlerexception.INTVAL count_exception_handlersPMC *get_exception_handlerPMC *get_all_exception_handlersvoid pop_exceptionPMC *new_c_exception_handlervoid push_new_c_exception_handleropcode_t *throw_exceptionopcode_t *rethrow_exceptionvoid rethrow_c_exceptionnew_c_exception.static opcode_t *create_exceptionsize_t handle_exceptionvoid new_internal_exceptionvoid free_internal_exceptionvoid destroy_exception_listvoid really_destroy_exception_listdestroy_exception_list.void do_exceptionlongjmp in front of the runloop,
which calls handle_exception(),
returning the handler address where execution then resumes.void do_str_exceptionvoid do_pmc_exception    the_exception->error = E_RuntimeError;
    the_exception->severity = EXCEPT_error;
    the_exception->msg = msg;
    the_exception->resume = NULL;
    longjmp(the_exception->destination, 1);
}
    the_exception->error = E_RuntimeError;
    the_exception->severity = EXCEPT_error;
    the_exception->msg = VTABLE_get_string(interp, msg);;
    the_exception->resume = NULL;
    longjmp(the_exception->destination, 1);
}
    the_exception->error = error;
    the_exception->severity = severity;
    the_exception->msg = NULL;
    the_exception->resume = NULL;
    longjmp(the_exception->destination, 1);
}
void real_exceptionret_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.void Parrot_init_exceptionsvoid Parrot_assertvoid Parrot_confessvoid Parrot_print_backtraceParrot_confess.
include/parrot/exceptions.h.
|  |   |