jit_exception_builtin

Function jit_exception_builtin 

Source
pub unsafe extern "C" fn jit_exception_builtin(exception_type: c_int)
Expand description

This function is called to report a builtin exception. The JIT will automatically embed calls to this function wherever a builtin exception needs to be reported. When a builtin exception occurs, the current thread’s exception handler is called to construct an appropriate object, which is then thrown. If there is no exception handler set, or the handler returns NULL, then libjit will print an error message to stderr and cause the program to exit with a status of 1. You normally don’t want this behavior and you should override it if possible.

The following builtin exception types are currently supported:

TypeDescription
JIT_RESULT_OKThe operation was performed successfully (value is 1).
JIT_RESULT_OVERFLOWThe operation resulted in an overflow exception (value is 0).
JIT_RESULT_ARITHMETICThe operation resulted in an arithmetic exception. i.e. an attempt was made to divide the minimum integer value by -1 (value is -1).
JIT_RESULT_DIVISION_BY_ZEROThe operation resulted in a division by zero exception (value is -2).
JIT_RESULT_COMPILE_ERRORAn error occurred when attempting to dynamically compile a function (value is -3).
JIT_RESULT_OUT_OF_MEMORYThe system ran out of memory while performing an operation (value is -4).
JIT_RESULT_NULL_REFERENCEAn attempt was made to dereference a NULL pointer (value is -5).
JIT_RESULT_NULL_FUNCTIONAn attempt was made to call a function with a NULL function pointer (value is -6).
JIT_RESULT_CALLED_NESTEDAn attempt was made to call a nested function from a non-nested context (value is -7).
JIT_RESULT_OUT_OF_BOUNDSThe operation resulted in an out of bounds array access (value is -8).
JIT_RESULT_UNDEFINED_LABELA branch operation used a label that was not defined anywhere in the function (value is -9).