From ca114c442d68f59775194d66894923bd517980cb Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 5 Nov 2015 06:20:43 -0800 Subject: 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. --- unwind.c | 1 + 1 file changed, 1 insertion(+) 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)) -- cgit v1.2.3