summaryrefslogtreecommitdiff
path: root/libguile/control.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2013-11-21 12:12:38 +0100
committerAndy Wingo <wingo@pobox.com>2013-11-21 16:51:15 +0100
commit0bca90aac9a209b2ae06281b00d5c3b9939d605e (patch)
tree4d7e5f3c9d182644b815bda04bb5cd5e1a318ad2 /libguile/control.c
parenta3da449801895e3f61aa2e085e7f4ff27c0f202c (diff)
downloadguile-0bca90aac9a209b2ae06281b00d5c3b9939d605e.tar.gz
The dynamic stack records SP and FP values as offsets
* libguile/dynstack.h: * libguile/dynstack.c (PROMPT_FP, PROMPT_SP): (scm_dynstack_push_prompt, scm_dynstack_find_prompt): Prompts on the dynstack are recorded as offsets from the base stack address in this thread. * libguile/control.c (scm_c_abort): * libguile/eval.c (eval): * libguile/stacks.c (find_prompt, narrow_stack): * libguile/throw.c (pre_init_catch): * libguile/vm-engine.c (prompt): Adapt.
Diffstat (limited to 'libguile/control.c')
-rw-r--r--libguile/control.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libguile/control.c b/libguile/control.c
index 0ef8e234c..e32608688 100644
--- a/libguile/control.c
+++ b/libguile/control.c
@@ -129,17 +129,22 @@ scm_c_abort (SCM vm, SCM tag, size_t n, SCM *argv,
scm_t_dynstack *dynstack = &SCM_I_CURRENT_THREAD->dynstack;
scm_t_bits *prompt;
scm_t_dynstack_prompt_flags flags;
+ scm_t_ptrdiff fp_offset, sp_offset;
SCM *fp, *sp;
scm_t_uint32 *ip;
scm_i_jmp_buf *registers;
size_t i;
prompt = scm_dynstack_find_prompt (dynstack, tag,
- &flags, &fp, &sp, &ip, &registers);
+ &flags, &fp_offset, &sp_offset, &ip,
+ &registers);
if (!prompt)
scm_misc_error ("abort", "Abort to unknown prompt", scm_list_1 (tag));
+ fp = SCM_VM_DATA (vm)->stack_base + fp_offset;
+ sp = SCM_VM_DATA (vm)->stack_base + sp_offset;
+
/* Only reify if the continuation referenced in the handler. */
if (flags & SCM_F_DYNSTACK_PROMPT_ESCAPE_ONLY)
cont = SCM_BOOL_F;