mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-14 23:50:19 +02:00
Allow abort_to_prompt to avoid a longjmp
* libguile/vm-engine.c (abort): * libguile/vm.c (abort_to_prompt): Allow fallthrough if longjmp isn't needed.
This commit is contained in:
parent
bf66fdca55
commit
51e71a473f
2 changed files with 11 additions and 7 deletions
|
@ -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
|
||||
|
|
|
@ -1403,11 +1403,11 @@ abort_to_prompt (scm_thread *thread, jmp_buf *current_registers)
|
|||
vp->sp = sp;
|
||||
vp->ip = ip;
|
||||
|
||||
/* Jump! */
|
||||
/* 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);
|
||||
|
||||
/* Shouldn't get here */
|
||||
abort ();
|
||||
}
|
||||
|
||||
SCM
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue