summaryrefslogtreecommitdiff
path: root/libguile/dynstack.h
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2017-02-07 09:28:39 +0100
committerAndy Wingo <wingo@pobox.com>2017-02-07 09:57:55 +0100
commit498f3f95684361f3591106a8f9cb9065fd649288 (patch)
tree70a8e33d1ea25c54c273a3cbe347010403dfb07c /libguile/dynstack.h
parent81e9a128c146ccd495846ecbf664b3fd2855baf1 (diff)
downloadguile-498f3f95684361f3591106a8f9cb9065fd649288.tar.gz
Avoid stacks in dynamically-bound values
* libguile/dynstack.h: * libguile/dynstack.c (scm_dynstack_find_old_fluid_value): New function. * libguile/fluids.c (saved_dynamic_state_ref): New helper. (scm_fluid_ref): Fix docstring. (scm_fluid_ref_star): New function allowing access to previous values for a fluid. (scm_dynamic_state_ref): New internal function. * libguile/fluids.h: Add scm_fluid_ref_star and scm_dynamic_state_ref. * libguile/stacks.c (scm_stack_id): Adapt to %stacks not being a chain. * libguile/throw.c (catch, throw_without_pre_unwind): Adapt to %exception-handlers not being a chain. * module/ice-9/boot-9.scm (catch, dispatch-exception): Instead of having %exception-handlers be a chain, use fluid-ref* to access the chain that is in place at the time the exception is thrown. Prevents unintended undelimited capture of the current exception handler stack by a delimited "catch". (%start-stack): Similarly, don't be a chain. * module/system/repl/debug.scm (frame->stack-vector): * module/system/repl/error-handling.scm (call-with-error-handling): * module/ice-9/save-stack.scm (save-stack): Adapt to %stacks not being a chain. * test-suite/tests/exceptions.test ("delimited exception handlers"): Add tests. * doc/ref/api-control.texi (Fluids and Dynamic States): Add docs.
Diffstat (limited to 'libguile/dynstack.h')
-rw-r--r--libguile/dynstack.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/libguile/dynstack.h b/libguile/dynstack.h
index 9d91fb667..7e191fc27 100644
--- a/libguile/dynstack.h
+++ b/libguile/dynstack.h
@@ -201,6 +201,9 @@ SCM_INTERNAL scm_t_bits* scm_dynstack_find_prompt (scm_t_dynstack *, SCM,
scm_t_uint32 **,
scm_i_jmp_buf **);
+SCM_INTERNAL SCM scm_dynstack_find_old_fluid_value (scm_t_dynstack *,
+ SCM, size_t, SCM);
+
SCM_INTERNAL void scm_dynstack_wind_prompt (scm_t_dynstack *, scm_t_bits *,
scm_t_ptrdiff, scm_i_jmp_buf *);