summaryrefslogtreecommitdiffstats
path: root/unwind.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-11-05 06:20:43 -0800
committerKaz Kylheku <kaz@kylheku.com>2015-11-05 06:20:43 -0800
commitca114c442d68f59775194d66894923bd517980cb (patch)
tree2098b1c63bc293690cc00799b2a12ccfd0c48327 /unwind.c
parent33719b3b1101faef84ca091540caffb652b9d0dd (diff)
downloadtxr-ca114c442d68f59775194d66894923bd517980cb.tar.gz
txr-ca114c442d68f59775194d66894923bd517980cb.tar.bz2
txr-ca114c442d68f59775194d66894923bd517980cb.zip
Clear stack area below revived continuation.
* unwind.c (revive_cont): Don't just reserve frame_slack bytes below the continuation for any stack frame, but clear the bytes to zero. On Cygwin, this fixes a failing continuation test case. The issue is that the cont_obj variable in capture_cont lands into this area (implying it is not captured). When the continuation is revived, the variable has a garbage value, rather than nil, as expected.
Diffstat (limited to 'unwind.c')
-rw-r--r--unwind.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/unwind.c b/unwind.c
index cf242b20..3846fa5c 100644
--- a/unwind.c
+++ b/unwind.c
@@ -744,6 +744,7 @@ static val revive_cont(val dc, val arg)
uw_frame_t *new_uw_stack = coerce(uw_frame_t *, space), *fr;
int env_set = 0;
+ memset(space - frame_slack, 0, frame_slack);
memcpy(space, cont->stack, cont->size);
for (ptr = space; ptr < space + cont->size; ptr += sizeof (cnum))