/*
* Builtin exception type codes, and result values for intrinsic functions.
*/
-#define JIT_RESULT_OK 1
-#define JIT_RESULT_OVERFLOW 0
-#define JIT_RESULT_ARITHMETIC -1
-#define JIT_RESULT_DIVISION_BY_ZERO -2
-#define JIT_RESULT_COMPILE_ERROR -3
-#define JIT_RESULT_OUT_OF_MEMORY -4
-#define JIT_RESULT_NULL_REFERENCE -5
-#define JIT_RESULT_NULL_FUNCTION -6
-#define JIT_RESULT_CALLED_NESTED -7
-#define JIT_RESULT_OUT_OF_BOUNDS -8
+#define JIT_RESULT_OK (1)
+#define JIT_RESULT_OVERFLOW (0)
+#define JIT_RESULT_ARITHMETIC (-1)
+#define JIT_RESULT_DIVISION_BY_ZERO (-2)
+#define JIT_RESULT_COMPILE_ERROR (-3)
+#define JIT_RESULT_OUT_OF_MEMORY (-4)
+#define JIT_RESULT_NULL_REFERENCE (-5)
+#define JIT_RESULT_NULL_FUNCTION (-6)
+#define JIT_RESULT_CALLED_NESTED (-7)
+#define JIT_RESULT_OUT_OF_BOUNDS (-8)
+#define JIT_RESULT_UNDEFINED_LABEL (-9)
/*
* Exception handling function for builtin exceptions.
jit_exception_func jit_exception_get_handler(void);
jit_stack_trace_t jit_exception_get_stack_trace(void);
unsigned int jit_stack_trace_get_size(jit_stack_trace_t trace);
-jit_function_t jit_stack_trace_get_function
- (jit_context_t context, jit_stack_trace_t trace, unsigned int posn);
-void *jit_stack_trace_get_pc
- (jit_stack_trace_t trace, unsigned int posn);
-unsigned int jit_stack_trace_get_offset
- (jit_context_t context, jit_stack_trace_t trace, unsigned int posn);
+jit_function_t jit_stack_trace_get_function(jit_context_t context,
+ jit_stack_trace_t trace,
+ unsigned int posn);
+void *jit_stack_trace_get_pc(jit_stack_trace_t trace, unsigned int posn);
+unsigned int jit_stack_trace_get_offset(jit_context_t context,
+ jit_stack_trace_t trace,
+ unsigned int posn);
void jit_stack_trace_free(jit_stack_trace_t trace);
#ifdef __cplusplus
#include "jit-rules.h"
#include <config.h>
#ifdef HAVE_STDLIB_H
- #include <stdlib.h>
+# include <stdlib.h>
#endif
#if defined(JIT_BACKEND_INTERP)
- #include "jit-interp.h"
+# include "jit-interp.h"
#endif
#include <stdio.h>
#include "jit-setjmp.h"
* @item JIT_RESULT_CALLED_NESTED
* An attempt was made to call a nested function from a non-nested context
* (value is -7).
+ *
+ * @vindex JIT_RESULT_OUT_OF_BOUNDS
+ * @item JIT_RESULT_OUT_OF_BOUNDS
+ * The operation resulted in an out of bounds array access (value is -8).
+ *
+ * @vindex JIT_RESULT_UNDEFINED_LABEL
+ * @item JIT_RESULT_UNDEFINED_LABEL
+ * A branch operation used a label that was not defined anywhere in the
+ * function (value is -9).
* @end table
* @end deftypefun
@*/
"Null pointer dereferenced",
"Null function pointer called",
"Nested function called from non-nested context",
- "Array index out of bounds"
+ "Array index out of bounds",
+ "Undefined label"
};
#define num_messages (sizeof(messages) / sizeof(const char *))