diff options
author | Andy Wingo <wingo@pobox.com> | 2011-02-11 15:30:25 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2011-02-11 15:30:25 +0100 |
commit | 39d41afe18846ac9137d1190032994d66112e48b (patch) | |
tree | 9cd23710bc62152764459468a5dd54ed0295eec2 /libguile/throw.c | |
parent | 9179e8a5ff00eeb7d42b66dcdb038a35fc54d5fc (diff) |
better narrowing in catch-all handlers in throw.c
* libguile/throw.c (handler_message): Narrow away the catch-closure and
throw frames.
Diffstat (limited to 'libguile/throw.c')
-rw-r--r-- | libguile/throw.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libguile/throw.c b/libguile/throw.c index 94783e002..750e6a286 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)) |