1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

record IP in partial continuations

* libguile/control.c (reify_partial_continuation): Assert some
  invariants, and record the IP as the MVRA of the continuation.
This commit is contained in:
Andy Wingo 2010-02-24 16:56:05 +01:00
parent ac644098bf
commit 6d804376e9

View file

@ -144,11 +144,20 @@ reify_partial_continuation (SCM vm, SCM prompt, SCM extwinds,
if (cookie >= 0 && SCM_PROMPT_REGISTERS (prompt)->cookie == cookie) if (cookie >= 0 && SCM_PROMPT_REGISTERS (prompt)->cookie == cookie)
flags |= SCM_F_VM_CONT_REWINDABLE; flags |= SCM_F_VM_CONT_REWINDABLE;
/* NULL RA and MVRA, as those get set when the cont is reinstated */ /* Since non-escape continuations should begin with a thunk application, the
vm_cont = scm_i_vm_capture_stack (SCM_PROMPT_REGISTERS (prompt)->sp, 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)->fp,
SCM_VM_DATA (vm)->sp, SCM_VM_DATA (vm)->sp,
NULL, NULL, NULL,
SCM_VM_DATA (vm)->ip,
flags); flags);
ret = scm_make_program (cont_objcode, ret = scm_make_program (cont_objcode,