From: Aleksey Demakov Date: Sun, 12 Oct 2008 17:06:35 +0000 (+0000) Subject: fix exception handling in interpreter X-Git-Tag: before.move.to.git~55 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=70245dec19d547abda853a58c292d0ff1b043a0c;p=francis%2Flibjit.git fix exception handling in interpreter --- 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; } }