1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-01 20:30:28 +02:00

Fix case where running abort hook could trash registers

* libguile/vm-engine.c (abort): If the abort doesn't need to longjmp and
  the abort hook was enabled, cache registers first to avoid restoring
  a bad IP to the VM.
This commit is contained in:
Andy Wingo 2018-09-22 17:31:14 +02:00
parent 9505263fda
commit 1e7c541b2f

View file

@ -1118,14 +1118,17 @@ VM_NAME (scm_thread *thread)
intervening C frames to jump over, so we just continue
directly. */
CACHE_REGISTER ();
ABORT_HOOK ();
#if ENABLE_JIT
if (mcode && !VP->disable_mcode)
{
scm_jit_enter_mcode (thread, mcode);
CACHE_REGISTER ();
}
#endif
CACHE_REGISTER ();
NEXT (0);
}