X-Git-Url: https://git.hcoop.net/bpt/guile.git/blobdiff_plain/9179e8a5ff00eeb7d42b66dcdb038a35fc54d5fc..51a1763f6596d594ebd774e7c3fd9138e6f4d507:/libguile/throw.c diff --git a/libguile/throw.c b/libguile/throw.c index 94783e002..9c293516d 100644 --- a/libguile/throw.c +++ b/libguile/throw.c @@ -353,7 +353,13 @@ handler_message (void *handler_data, SCM tag, SCM args) SCM p, stack, frame; p = scm_current_error_port (); - stack = scm_make_stack (SCM_BOOL_T, SCM_EOL); + /* Usually we get here via a throw to a catch-all. In that case + there is the throw frame active, and the catch closure, so narrow by + two frames. It is possible for a user to invoke + scm_handle_by_message directly, though, so it could be this + narrows too much. We'll have to see how this works out in + practice. */ + stack = scm_make_stack (SCM_BOOL_T, scm_list_1 (scm_from_int (2))); frame = scm_is_true (stack) ? scm_stack_ref (stack, SCM_INUM0) : SCM_BOOL_F; if (should_print_backtrace (tag, stack)) @@ -461,7 +467,7 @@ pre_init_catch (SCM tag, SCM thunk, SCM handler, SCM pre_unwind_handler) if (SCM_PROMPT_SETJMP (prompt)) { /* nonlocal exit */ - SCM args = scm_i_prompt_pop_abort_args_x (prompt); + SCM args = scm_i_prompt_pop_abort_args_x (vm); /* cdr past the continuation */ return scm_apply_0 (handler, scm_cdr (args)); }