/* export variables ***********************************************************/
-extern java_object_t *_exceptionptr;
extern chain *nativemethod_chain;
extern chain *nativeclass_chain;
extern chain *ident_chain;
};
-/* exception pointer **********************************************************/
-
-#define exceptionptr (&(THREADOBJECT->_exceptionptr))
-
-
/* stackframeinfo *************************************************************/
#define STACKFRAMEINFO (THREADOBJECT->_stackframeinfo)
#define threadobject void
-/* exception pointer **********************************************************/
-
-extern java_object_t *_no_threads_exceptionptr;
-
-#define exceptionptr (&_no_threads_exceptionptr)
-
-
/* stackframeinfo *************************************************************/
struct stackframeinfo;
java_handle_t *exceptions_get_exception(void)
{
java_handle_t *e;
+#if defined(ENABLE_THREADS)
+ threadobject *t;
- /* get the exception */
+ t = THREADOBJECT;
+#endif
+
+ /* Get the exception. */
LLNI_CRITICAL_START;
- e = LLNI_WRAP(*exceptionptr);
+#if defined(ENABLE_THREADS)
+ e = LLNI_WRAP(t->_exceptionptr);
+#else
+ e = LLNI_WRAP(_no_threads_exceptionptr);
+#endif
LLNI_CRITICAL_END;
- /* return the exception */
+ /* Return the exception. */
return e;
}
void exceptions_set_exception(java_handle_t *o)
{
- /* set the exception */
+#if defined(ENABLE_THREADS)
+ threadobject *t;
+
+ t = THREADOBJECT;
+#endif
+
+ /* Set the exception. */
LLNI_CRITICAL_START;
- *exceptionptr = LLNI_UNWRAP(o);
+#if defined(ENABLE_THREADS)
+ t->_exceptionptr = LLNI_UNWRAP(o);
+#else
+ _no_threads_exceptionptr = LLNI_UNWRAP(o);
+#endif
LLNI_CRITICAL_END;
}
debug_verify_inlined_code = 0;
DOLOG( printf("VERIFYING INLINED RESULT...\n"); fflush(stdout); );
if (!typecheck(n_jd)) {
- *exceptionptr = NULL;
+ exceptions_clear_exception();
DOLOG( printf("XXX INLINED RESULT DID NOT PASS VERIFIER XXX\n") );
return false;
}