diff options
author | Andy Wingo <wingo@pobox.com> | 2018-09-22 17:31:14 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2018-09-22 17:33:58 +0200 |
commit | 1e7c541b2f332daf5fb1c35a0b3f7d15cd0e36bc (patch) | |
tree | afb719872b39230e12ea930ddb7603e5ef6eaa0a /libguile/vm-engine.c | |
parent | 9505263fda8963fb82b723aec2c347970acb84af (diff) | |
download | guile-1e7c541b2f332daf5fb1c35a0b3f7d15cd0e36bc.tar.gz |
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.
Diffstat (limited to 'libguile/vm-engine.c')
-rw-r--r-- | libguile/vm-engine.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libguile/vm-engine.c b/libguile/vm-engine.c index 4e0ef77ec..542cac413 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); } |