Current exception signalling mechanism of jato no longer uses
getExecEnv()->exception but another thread-specific variable. Jato
also uses guard pages for signaling asynchronous exceptions. Therefore
jamvm should call jato's exception signalling functions so that
exceptions it generates will be visible to jato code too.

Signed-off-by: Tomek Grabiec <[email protected]>
---
 jamvm/excep.c  |    4 ++++
 jamvm/interp.c |    1 +
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/jamvm/excep.c b/jamvm/excep.c
index 72f6ac1..72b2b89 100644
--- a/jamvm/excep.c
+++ b/jamvm/excep.c
@@ -21,6 +21,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <jit/exception.h>
 #include "jam.h"
 #include "lock.h"
 
@@ -88,6 +89,7 @@ void signalChainedException(char *excep_name, char *message, 
Object *cause) {
                 }
 
                 getExecEnv()->exception = exp;
+               signal_exception(exp);
             }
         }
     }
@@ -95,6 +97,7 @@ void signalChainedException(char *excep_name, char *message, 
Object *cause) {
 
 void setException(Object *exp) {
     getExecEnv()->exception = exp;
+    signal_exception(exp);
 }
 
 void clearException() {
@@ -105,6 +108,7 @@ void clearException() {
         ee->stack_end -= STACK_RED_ZONE_SIZE;
     }
     ee->exception = NULL;
+    clear_exception();
 }
 
 void printException() {
diff --git a/jamvm/interp.c b/jamvm/interp.c
index 483425e..baa3469 100644
--- a/jamvm/interp.c
+++ b/jamvm/interp.c
@@ -2292,6 +2292,7 @@ throwException:
     {
         Object *excep = ee->exception;
         ee->exception = NULL;
+       clear_exception();
 
         pc = findCatchBlock(excep->class);
 
-- 
1.6.0.6


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Jatovm-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jatovm-devel

Reply via email to