From 9144d264ae9600fca5d38affdda262f7ea46282f Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 27 Oct 2015 06:12:57 -0700 Subject: Fix size growth of nested continuation capture. The issue is that captures from within a restarted continuation of the same continuation, are using the restart prompt as the delimiter rather than re-using captured block of the same name. Thus each successive capture adds a new frame, causing the size to grow drastically. * unwind.c (uw_capture_cont): Allow the existing captured block to be the delimiter; don't delimit up to the revive_cont's prompt block of the same name. --- unwind.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/unwind.c b/unwind.c index 1da59d19..0202f4e4 100644 --- a/unwind.c +++ b/unwind.c @@ -751,7 +751,8 @@ val uw_capture_cont(val tag, val ctx) uw_frame_t *fr; for (fr = uw_stack; fr != 0; fr = fr->uw.up) { - if (fr->uw.type == UW_BLOCK && fr->bl.tag == tag) + if ((fr->uw.type == UW_BLOCK || fr->uw.type == UW_CAPTURED_BLOCK) + && fr->bl.tag == tag) break; } -- cgit v1.2.3