diff options
author | Andy Wingo <wingo@pobox.com> | 2010-02-24 16:56:05 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2010-02-24 16:56:05 +0100 |
commit | 6d804376e94d17cf013a415c4bd98d632f7a91b9 (patch) | |
tree | 88116e69e1bca68ee688eb34a8cac7130bf29d59 /libguile/control.c | |
parent | ac644098bf1573cfbb4ee032e6cd32a23ca168b6 (diff) | |
download | guile-6d804376e94d17cf013a415c4bd98d632f7a91b9.tar.gz |
record IP in partial continuations
* libguile/control.c (reify_partial_continuation): Assert some
invariants, and record the IP as the MVRA of the continuation.
Diffstat (limited to 'libguile/control.c')
-rw-r--r-- | libguile/control.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/libguile/control.c b/libguile/control.c index 25c95047b..cffc00781 100644 --- a/libguile/control.c +++ b/libguile/control.c @@ -144,11 +144,20 @@ reify_partial_continuation (SCM vm, SCM prompt, SCM extwinds, if (cookie >= 0 && SCM_PROMPT_REGISTERS (prompt)->cookie == cookie) flags |= SCM_F_VM_CONT_REWINDABLE; - /* NULL RA and MVRA, as those get set when the cont is reinstated */ - vm_cont = scm_i_vm_capture_stack (SCM_PROMPT_REGISTERS (prompt)->sp, + /* Since non-escape continuations should begin with a thunk application, the + first bit of the stack should be a frame, with the saved fp equal to the fp + that was current when the prompt was made. */ + if ((SCM*)(SCM_PROMPT_REGISTERS (prompt)->sp[1]) + != SCM_PROMPT_REGISTERS (prompt)->fp) + abort (); + + /* Capture from the top of the thunk application frame up to the end. Set an + MVRA only, as the post-abort code is in an MV context. */ + vm_cont = scm_i_vm_capture_stack (SCM_PROMPT_REGISTERS (prompt)->sp + 4, SCM_VM_DATA (vm)->fp, SCM_VM_DATA (vm)->sp, - NULL, NULL, + NULL, + SCM_VM_DATA (vm)->ip, flags); ret = scm_make_program (cont_objcode, |