summaryrefslogtreecommitdiff
path: root/libguile/stacks.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2013-11-21 11:20:19 +0100
committerAndy Wingo <wingo@pobox.com>2013-11-21 11:20:19 +0100
commit89b235afd34482f2e7d2af553f43d0744895ee83 (patch)
tree520831cc6c7c85e5994bc253e02a4a200fcaef47 /libguile/stacks.c
parenteadd9eb4c9f658c9a6081d1b644c7c472d241061 (diff)
downloadguile-89b235afd34482f2e7d2af553f43d0744895ee83.tar.gz
Scheme frame objects hold relative stack offsets
* libguile/frames.h: Wrap the C interface to VM frames in BUILDING_LIBGUILE. Change VM frames to record relative offsets into a stack held by some other object, so that if the stack moves they will remain valid. * libguile/frames.c (scm_c_make_frame): Remove offset argument. (scm_i_frame_offset): Instead, compute the offset from the stack holder. (scm_i_frame_stack_base): New helper. (scm_frame_previous): Adapt. * libguile/stacks.c (scm_make_stack) * libguile/vm.c (vm_dispatch_hook): * libguile/continuations.c (scm_i_continuation_to_frame): Adapt.
Diffstat (limited to 'libguile/stacks.c')
-rw-r--r--libguile/stacks.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libguile/stacks.c b/libguile/stacks.c
index 20b67ef56..4b3016a4f 100644
--- a/libguile/stacks.c
+++ b/libguile/stacks.c
@@ -258,9 +258,10 @@ SCM_DEFINE (scm_make_stack, "make-stack", 1, 0, 1,
cont = scm_i_capture_current_stack ();
c = SCM_VM_CONT_DATA (cont);
- frame = scm_c_make_frame (cont, c->fp + c->reloc,
- c->sp + c->reloc, c->ra,
- c->reloc);
+ frame = scm_c_make_frame (cont,
+ (c->fp + c->reloc) - c->stack_base,
+ (c->sp + c->reloc) - c->stack_base,
+ c->ra);
}
else if (SCM_VM_FRAME_P (obj))
frame = obj;