diff options
author | Andy Wingo <wingo@pobox.com> | 2013-11-21 12:12:38 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2013-11-21 16:51:15 +0100 |
commit | 0bca90aac9a209b2ae06281b00d5c3b9939d605e (patch) | |
tree | 4d7e5f3c9d182644b815bda04bb5cd5e1a318ad2 /libguile/stacks.c | |
parent | a3da449801895e3f61aa2e085e7f4ff27c0f202c (diff) | |
download | guile-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/stacks.c')
-rw-r--r-- | libguile/stacks.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libguile/stacks.c b/libguile/stacks.c index 4b3016a4f..97b1495b8 100644 --- a/libguile/stacks.c +++ b/libguile/stacks.c @@ -95,17 +95,17 @@ stack_depth (SCM frame) * encountered. */ -static SCM* +static scm_t_ptrdiff find_prompt (SCM key) { - SCM *fp; + scm_t_ptrdiff fp_offset; if (!scm_dynstack_find_prompt (&SCM_I_CURRENT_THREAD->dynstack, key, - NULL, &fp, NULL, NULL, NULL)) + NULL, &fp_offset, NULL, NULL, NULL)) scm_misc_error ("make-stack", "Prompt tag not found while narrowing stack", scm_list_1 (key)); - return fp; + return fp_offset; } static void @@ -144,9 +144,9 @@ narrow_stack (SCM stack, SCM inner_cut, SCM outer_cut) else { /* Cut until the given prompt tag is seen. */ - SCM *fp = find_prompt (inner_cut); + scm_t_ptrdiff fp_offset = find_prompt (inner_cut); for (; len; len--, frame = scm_frame_previous (frame)) - if (fp == SCM_VM_FRAME_FP (frame) - SCM_VM_FRAME_OFFSET (frame)) + if (fp_offset == SCM_VM_FRAME_FP_OFFSET (frame)) break; } @@ -178,12 +178,12 @@ narrow_stack (SCM stack, SCM inner_cut, SCM outer_cut) else { /* Cut until the given prompt tag is seen. */ - SCM *fp = find_prompt (outer_cut); + scm_t_ptrdiff fp_offset = find_prompt (outer_cut); while (len) { frame = scm_stack_ref (stack, scm_from_long (len - 1)); len--; - if (fp == SCM_VM_FRAME_FP (frame) - SCM_VM_FRAME_OFFSET (frame)) + if (fp_offset == SCM_VM_FRAME_FP_OFFSET (frame)) break; } } |