]> git.unchartedbackwaters.co.uk Git - francis/libjit.git/commitdiff
fix exception handling in interpreter
authorAleksey Demakov <ademakov@gmail.com>
Sun, 12 Oct 2008 17:06:35 +0000 (17:06 +0000)
committerAleksey Demakov <ademakov@gmail.com>
Sun, 12 Oct 2008 17:06:35 +0000 (17:06 +0000)
ChangeLog
jit/jit-interp.c

index 289fb9a1be6b2374b1d199c9455fb08b56d2b10f..1f57fb8cb37b2d9c9a93d67dc2d221b3fe92a591 100644 (file)
--- 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  <ademakov@gmail.com>
 
        * jit/jit-interp.c (_jit_run_function): fix implementation of the
index 8e208a24578e5a3d6c296af84961147ad4b03f9a..309bea2d5e00b7642e00f488e8e8528a4853d5b7 100644 (file)
@@ -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;
                                }
                        }