[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 01/02: Fix case where running abort hook could trash reg
From: |
Andy Wingo |
Subject: |
[Guile-commits] 01/02: Fix case where running abort hook could trash registers |
Date: |
Sat, 22 Sep 2018 12:49:49 -0400 (EDT) |
wingo pushed a commit to branch master
in repository guile.
commit 1e7c541b2f332daf5fb1c35a0b3f7d15cd0e36bc
Author: Andy Wingo <address@hidden>
Date: Sat Sep 22 17:31:14 2018 +0200
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.
---
libguile/vm-engine.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/libguile/vm-engine.c b/libguile/vm-engine.c
index 4e0ef77..542cac4 100644
--- a/libguile/vm-engine.c
+++ b/libguile/vm-engine.c
@@ -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);
+ {
+ scm_jit_enter_mcode (thread, mcode);
+ CACHE_REGISTER ();
+ }
#endif
- CACHE_REGISTER ();
NEXT (0);
}