diff options
-rw-r--r-- | libguile/vm-engine.c | 8 | ||||
-rw-r--r-- | libguile/vm.c | 10 |
2 files changed, 11 insertions, 7 deletions
diff --git a/libguile/vm-engine.c b/libguile/vm-engine.c index 7fc549970..71b3dfd5a 100644 --- a/libguile/vm-engine.c +++ b/libguile/vm-engine.c @@ -788,8 +788,12 @@ VM_NAME (scm_thread *thread, jmp_buf *registers, int resume) SYNC_IP (); scm_vm_intrinsics.abort_to_prompt (thread, registers); - /* vm_abort should not return */ - abort (); + /* If abort_to_prompt returned, that means there were no + intervening C frames to jump over, so we just continue + directly. */ + CACHE_REGISTER (); + ABORT_CONTINUATION_HOOK (); + NEXT (0); } /* builtin-ref dst:12 idx:12 diff --git a/libguile/vm.c b/libguile/vm.c index 0d424ec11..45040993f 100644 --- a/libguile/vm.c +++ b/libguile/vm.c @@ -1403,11 +1403,11 @@ abort_to_prompt (scm_thread *thread, jmp_buf *current_registers) vp->sp = sp; vp->ip = ip; - /* Jump! */ - longjmp (*registers, 1); - - /* Shouldn't get here */ - abort (); + /* If there are intervening C frames, then jump over them, making a + nonlocal exit. Otherwise fall through and let the VM pick up where + it left off. */ + if (current_registers != registers) + longjmp (*registers, 1); } SCM |