From 70245dec19d547abda853a58c292d0ff1b043a0c Mon Sep 17 00:00:00 2001 From: Aleksey Demakov Date: Sun, 12 Oct 2008 17:06:35 +0000 Subject: [PATCH] fix exception handling in interpreter --- ChangeLog | 3 +++ jit/jit-interp.c | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 289fb9a..1f57fb8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,9 @@ * jit/jit-unwind.c: fix typos. + * jit/jit-interp.c (_jit_run_function): adjust exception_pc if + exception is generated by a previous instruction. + 2008-10-05 Aleksey Demakov * jit/jit-interp.c (_jit_run_function): fix implementation of the diff --git a/jit/jit-interp.c b/jit/jit-interp.c index 8e208a2..309bea2 100644 --- a/jit/jit-interp.c +++ b/jit/jit-interp.c @@ -343,6 +343,7 @@ restart_tail: { /* An exception has been thrown by lower-level code */ exception_object = jit_exception_get_last_and_clear(); + exception_pc = pc - 1; goto handle_exception; } } @@ -3620,8 +3621,8 @@ restart_tail: { /* Throw an exception, which may be handled in this function */ exception_object = VM_R1_PTR; - handle_exception: exception_pc = pc; + handle_exception: tempptr = jit_function_from_pc(func->func->context, pc, &handler); if(tempptr == func->func && handler != 0) { @@ -4058,6 +4059,7 @@ restart_tail: if(setjmp(jbuf->buf)) { exception_object = jit_exception_get_last_and_clear(); + exception_pc = pc - 1; goto handle_exception; } } -- 2.47.3