1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-30 23:10:21 +02:00

vm hooks run without hooks

* libguile/vm.c (vm_dispatch_hook): Run hooks with the trace-level set
  to 0. We really don't want hooks running while hooks are running.
This commit is contained in:
Andy Wingo 2010-09-17 10:59:36 +02:00
parent e912d7d5af
commit 893fb8d0cc

View file

@ -193,6 +193,7 @@ vm_dispatch_hook (SCM vm, int hook_num)
struct scm_frame c_frame;
scm_t_aligned_cell frame;
SCM args[1];
int saved_trace_level;
vp = SCM_VM_DATA (vm);
hook = vp->hooks[hook_num];
@ -201,7 +202,8 @@ vm_dispatch_hook (SCM vm, int hook_num)
|| scm_is_null (SCM_HOOK_PROCEDURES (hook)))
return;
vp->trace_level--;
saved_trace_level = vp->trace_level;
vp->trace_level = 0;
/* 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
@ -222,7 +224,7 @@ vm_dispatch_hook (SCM vm, int hook_num)
scm_c_run_hookn (hook, args, 1);
vp->trace_level++;
vp->trace_level = saved_trace_level;
}
static void vm_abort (SCM vm, size_t n, scm_t_int64 cookie) SCM_NORETURN;