summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2010-10-13 21:18:44 +0200
committerAndy Wingo <wingo@pobox.com>2010-10-13 21:20:23 +0200
commit2b41a37b3c4127d4a7f95d032ef63f9f8b9e5035 (patch)
tree84c826752cffe4b0b5057fb5112bad55d587dd08
parente78d4bf9a9501654024a18f8d0baa1597d57fcb8 (diff)
downloadguile-2b41a37b3c4127d4a7f95d032ef63f9f8b9e5035.tar.gz
fix bug in with-fluids in a non-tail position
* libguile/vm-i-system.c (VM_DEFINE_INSTRUCTION): Drop the stack items corresponding the the with-fluids object. Thanks very much to Stefan Israelsson Tampe for the fix.
-rw-r--r--libguile/vm-i-system.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libguile/vm-i-system.c b/libguile/vm-i-system.c
index 16b74e2b6..62b5e1a9c 100644
--- a/libguile/vm-i-system.c
+++ b/libguile/vm-i-system.c
@@ -1575,11 +1575,12 @@ VM_DEFINE_INSTRUCTION (89, wind_fluids, "wind-fluids", 1, -1, 0)
unsigned n = FETCH ();
SCM wf;
- if (sp - 2*n < SCM_FRAME_UPPER_ADDRESS (fp))
- goto vm_error_stack_underflow;
-
SYNC_REGISTER ();
- wf = scm_i_make_with_fluids (n, sp + 1 - 2*n, sp + 1 - n);
+ sp -= 2 * n;
+ CHECK_UNDERFLOW ();
+ wf = scm_i_make_with_fluids (n, sp + 1, sp + 1 + n);
+ NULLSTACK (2 * n);
+
scm_i_swap_with_fluids (wf, dynstate);
scm_i_set_dynwinds (scm_cons (wf, scm_i_dynwinds ()));
NEXT;