summaryrefslogtreecommitdiff
path: root/libguile/vm.c
diff options
context:
space:
mode:
Diffstat (limited to 'libguile/vm.c')
-rw-r--r--libguile/vm.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/libguile/vm.c b/libguile/vm.c
index fa2f171a6..cc95a2c75 100644
--- a/libguile/vm.c
+++ b/libguile/vm.c
@@ -1013,7 +1013,7 @@ cons_rest (scm_thread *thread, uint32_t base)
static void
push_interrupt_frame (scm_thread *thread)
{
- union scm_vm_stack_element *old_fp;
+ union scm_vm_stack_element *old_fp, *new_fp;
size_t old_frame_size = frame_locals_count (thread);
SCM proc = scm_i_async_pop (thread);
@@ -1024,13 +1024,14 @@ push_interrupt_frame (scm_thread *thread)
alloc_frame (thread, old_frame_size + 3);
old_fp = thread->vm.fp;
- thread->vm.fp = SCM_FRAME_SLOT (old_fp, old_frame_size + 1);
- SCM_FRAME_SET_DYNAMIC_LINK (thread->vm.fp, old_fp);
+ new_fp = SCM_FRAME_SLOT (old_fp, old_frame_size + 1);
+ SCM_FRAME_SET_DYNAMIC_LINK (new_fp, old_fp);
/* Arrange to return to the same handle-interrupts opcode to handle
any additional interrupts. */
- SCM_FRAME_SET_RETURN_ADDRESS (thread->vm.fp, thread->vm.ip);
+ SCM_FRAME_SET_RETURN_ADDRESS (new_fp, thread->vm.ip);
+ SCM_FRAME_LOCAL (new_fp, 0) = proc;
- SCM_FRAME_LOCAL (thread->vm.fp, 0) = proc;
+ thread->vm.fp = new_fp;
}
struct return_to_continuation_data
@@ -1402,7 +1403,6 @@ scm_call_n (SCM proc, SCM *argv, size_t nargs)
SCM_FRAME_LOCAL (return_fp, 0) = vm_boot_continuation;
vp->ip = (uint32_t *) vm_boot_continuation_code;
- vp->fp = call_fp;
SCM_FRAME_SET_RETURN_ADDRESS (call_fp, vp->ip);
SCM_FRAME_SET_DYNAMIC_LINK (call_fp, return_fp);
@@ -1410,6 +1410,8 @@ scm_call_n (SCM proc, SCM *argv, size_t nargs)
for (i = 0; i < nargs; i++)
SCM_FRAME_LOCAL (call_fp, i + 1) = argv[i];
+ vp->fp = call_fp;
+
{
jmp_buf registers;
int resume;