summaryrefslogtreecommitdiff
path: root/libguile/vm-i-system.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2010-02-25 17:33:12 +0100
committerAndy Wingo <wingo@pobox.com>2010-02-26 11:05:44 +0100
commitd296431516dbf14535fc6eaba551fede19c09772 (patch)
tree462156635e207a35b0f03d7bb044833278467c72 /libguile/vm-i-system.c
parentb8af64db76bc602517be300128be0dfb67fac89f (diff)
downloadguile-d296431516dbf14535fc6eaba551fede19c09772.tar.gz
fix a prompt bug
* libguile/control.h: * libguile/control.c (scm_c_make_prompt): Instead of taking a VM arg, take the registers directly. (scm_c_abort): Declare as returning void. In fact it will never return. * libguile/eval.c (eval): * libguile/throw.c (pre_init_catch): Adapt to prompt API change. * libguile/vm-i-system.c (prompt): Pass the abort ip as the ip to scm_c_make_prompt. This fixes a bug in which we used the "offset" local var, but it wasn't guaranteed to be around after a longjmp.
Diffstat (limited to 'libguile/vm-i-system.c')
-rw-r--r--libguile/vm-i-system.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/libguile/vm-i-system.c b/libguile/vm-i-system.c
index 56df7274e..262bb876d 100644
--- a/libguile/vm-i-system.c
+++ b/libguile/vm-i-system.c
@@ -1479,19 +1479,21 @@ VM_DEFINE_INSTRUCTION (83, prompt, "prompt", 4, 2, 0)
POP (k);
SYNC_REGISTER ();
- /* Push the prompt onto the dynamic stack. The setjmp itself has to be local
- to this procedure. */
- /* FIXME: do more error checking */
- prompt = scm_c_make_prompt (vm, k, escape_only_p, vm_cookie);
+ /* Push the prompt onto the dynamic stack. */
+ prompt = scm_c_make_prompt (k, fp, sp, ip + offset, escape_only_p, vm_cookie);
scm_i_set_dynwinds (scm_cons (prompt, scm_i_dynwinds ()));
if (SCM_PROMPT_SETJMP (prompt))
{
/* The prompt exited nonlocally. Cache the regs back from the vp, and go
to the handler.
+
+ Note, at this point, we must assume that any variable local to
+ vm_engine that can be assigned *has* been assigned. So we need to pull
+ all our state back from the ip/fp/sp.
*/
- CACHE_REGISTER (); /* Really we only need SP. FP and IP should be
- unmodified. */
- ip += offset;
+ CACHE_REGISTER ();
+ program = SCM_FRAME_PROGRAM (fp);
+ CACHE_PROGRAM ();
NEXT;
}