1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-15 16:20:17 +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:
Andy Wingo 2018-06-26 17:16:19 +02:00
parent bf66fdca55
commit 51e71a473f
2 changed files with 11 additions and 7 deletions

View file

@ -788,8 +788,12 @@ VM_NAME (scm_thread *thread, jmp_buf *registers, int resume)
SYNC_IP (); SYNC_IP ();
scm_vm_intrinsics.abort_to_prompt (thread, registers); scm_vm_intrinsics.abort_to_prompt (thread, registers);
/* vm_abort should not return */ /* If abort_to_prompt returned, that means there were no
abort (); intervening C frames to jump over, so we just continue
directly. */
CACHE_REGISTER ();
ABORT_CONTINUATION_HOOK ();
NEXT (0);
} }
/* builtin-ref dst:12 idx:12 /* builtin-ref dst:12 idx:12

View file

@ -1403,11 +1403,11 @@ abort_to_prompt (scm_thread *thread, jmp_buf *current_registers)
vp->sp = sp; vp->sp = sp;
vp->ip = ip; 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); longjmp (*registers, 1);
/* Shouldn't get here */
abort ();
} }
SCM SCM