mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-22 04:30:19 +02:00
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.
This commit is contained in:
parent
b294a1e7d7
commit
e2a06249ef
1 changed files with 4 additions and 0 deletions
|
@ -238,6 +238,7 @@ vm_dispatch_hook (struct scm_vm *vp, int hook_num,
|
||||||
struct scm_frame c_frame;
|
struct scm_frame c_frame;
|
||||||
scm_t_cell *frame;
|
scm_t_cell *frame;
|
||||||
int saved_trace_level;
|
int saved_trace_level;
|
||||||
|
scm_t_uint8 saved_compare_result;
|
||||||
|
|
||||||
hook = vp->hooks[hook_num];
|
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;
|
saved_trace_level = vp->trace_level;
|
||||||
vp->trace_level = 0;
|
vp->trace_level = 0;
|
||||||
|
|
||||||
|
saved_compare_result = vp->compare_result;
|
||||||
|
|
||||||
/* Allocate a frame object on the stack. This is more efficient than calling
|
/* 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
|
`scm_c_make_frame ()' to allocate on the heap, but it forces hooks to not
|
||||||
capture frame objects.
|
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));
|
scm_c_run_hook (hook, scm_cons (SCM_PACK_POINTER (frame), args));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vp->compare_result = saved_compare_result;
|
||||||
vp->trace_level = saved_trace_level;
|
vp->trace_level = saved_trace_level;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue