| parrotcode: Exceptions | |
| Contents | C |

src/exceptions.c - Exceptions

Define the internal interpreter exceptions.
enum_class of the Exception isn't fixed.
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.do_panicpush_exceptionParrot_push_actionParrot_push_markParrot_pop_markfind_exception_handlerexception.pop_exceptionnew_c_exception_handlerpush_new_c_exception_handlerthrow_exceptionrethrow_exceptionrethrow_c_exceptionnew_c_exception.dest2offsetcreate_exceptionhandle_exceptionnew_internal_exceptionfree_internal_exceptiondo_exceptionlongjmp 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_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.Parrot_init_exceptionsParrot_confess
include/parrot/exceptions.h.
|
|
|