signal_exception() should be called unconditionally. Assignemnt to REG_CX is unnecessary since it is no longer used to hold exception object reference at entry to unwind().
Signed-off-by: Tomek Grabiec <[email protected]> --- arch/x86/exception.c | 11 +++++------ arch/x86/include/arch/signal.h | 2 -- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/arch/x86/exception.c b/arch/x86/exception.c index e6d8c02..217e7a3 100644 --- a/arch/x86/exception.c +++ b/arch/x86/exception.c @@ -80,15 +80,14 @@ void throw_exception_from_trampoline(void *ctx, struct object *exception) stack = (unsigned long*)uc->uc_mcontext.gregs[REG_SP]; return_address = stack[1]; - if (!is_jit_method(return_address)) { - /* Signal exception and return to caller. */ - signal_exception(exception); + signal_exception(exception); + + if (!is_jit_method(return_address)) + /* Return to caller. */ uc->uc_mcontext.gregs[REG_IP] = return_address; - } else { + else /* Unwind to previous jit method. */ - uc->uc_mcontext.gregs[REG_CX] = (unsigned long)exception; uc->uc_mcontext.gregs[REG_IP] = (unsigned long)unwind; - } /* pop EBP from stack */ stack = (unsigned long*)uc->uc_mcontext.gregs[REG_SP]; diff --git a/arch/x86/include/arch/signal.h b/arch/x86/include/arch/signal.h index 313d9cb..1940a34 100644 --- a/arch/x86/include/arch/signal.h +++ b/arch/x86/include/arch/signal.h @@ -9,12 +9,10 @@ #define REG_IP REG_EIP #define REG_SP REG_ESP #define REG_BP REG_EBP - #define REG_CX REG_ECX #elif defined(CONFIG_X86_64) #define REG_IP REG_RIP #define REG_SP REG_RSP #define REG_BP REG_RBP - #define REG_CX REG_RCX #else #error Unsupported architecture #endif -- 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
