summaryrefslogtreecommitdiff
path: root/libguile/vm.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2018-01-08 15:19:55 +0100
committerAndy Wingo <wingo@pobox.com>2018-01-08 15:19:55 +0100
commite2a06249ef08889d7e97f9487561a81bc2321e9e (patch)
treeeff0dac7ce75e92c0343225f35e62f3bea275870 /libguile/vm.c
parentb294a1e7d7007755bfb1017495d4eb81fe62b53c (diff)
downloadguile-e2a06249ef08889d7e97f9487561a81bc2321e9e.tar.gz
Save VM compare result before calling out to hooks
* libguile/vm.c (vm_dispatch_hook): Save the compare result before calling out to the hook. This only really matters for the "next" hook, which can be called between a compare and its corresponding branch instruction.
Diffstat (limited to 'libguile/vm.c')
-rw-r--r--libguile/vm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libguile/vm.c b/libguile/vm.c
index feed5c8a7..529205576 100644
--- a/libguile/vm.c
+++ b/libguile/vm.c
@@ -238,6 +238,7 @@ vm_dispatch_hook (struct scm_vm *vp, int hook_num,
struct scm_frame c_frame;
scm_t_cell *frame;
int saved_trace_level;
+ scm_t_uint8 saved_compare_result;
hook = vp->hooks[hook_num];
@@ -248,6 +249,8 @@ vm_dispatch_hook (struct scm_vm *vp, int hook_num,
saved_trace_level = vp->trace_level;
vp->trace_level = 0;
+ saved_compare_result = vp->compare_result;
+
/* Allocate a frame object on the stack. This is more efficient than calling
`scm_c_make_frame ()' to allocate on the heap, but it forces hooks to not
capture frame objects.
@@ -293,6 +296,7 @@ vm_dispatch_hook (struct scm_vm *vp, int hook_num,
scm_c_run_hook (hook, scm_cons (SCM_PACK_POINTER (frame), args));
}
+ vp->compare_result = saved_compare_result;
vp->trace_level = saved_trace_level;
}