diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-10-26 06:16:32 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-10-26 06:16:32 -0700 |
commit | 2bd797a1aa9d30f15ae06fe5da8555906e9af894 (patch) | |
tree | 0b0a15ff3b3c1db2431b10824c770f77ab8e2da7 | |
parent | 596f3633c74f5dbd90768355e389ffadfbf2e89f (diff) | |
download | txr-2bd797a1aa9d30f15ae06fe5da8555906e9af894.tar.gz txr-2bd797a1aa9d30f15ae06fe5da8555906e9af894.tar.bz2 txr-2bd797a1aa9d30f15ae06fe5da8555906e9af894.zip |
Capture portion of stack beyond prompting block.
Without this we don't properly capture some of the context in
some built-in special operator functions like op_for when we
capture up to their implicit blocks.
* unwind.c (capture_cont): Capture an extra region of the
stack above the delimiting block. 32 words seems like a
reasonable fudge value.
-rw-r--r-- | unwind.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -716,8 +716,10 @@ static val capture_cont(val tag, uw_frame_t *block) bug_unless (uw_stack < block); { + const int capture_extra = 16 * sizeof (val); + mem_t *lim = coerce(mem_t *, block + 1) + capture_extra; cnum bloff = coerce(mem_t *, block) - coerce(mem_t *, uw_stack); - cnum size = bloff + sizeof *block; + cnum size = coerce(mem_t *, lim) - coerce(mem_t *, uw_stack); mem_t *stack = chk_malloc(size); uw_frame_t *blcopy = coerce(uw_frame_t *, stack + bloff); struct cont *cont = coerce(struct cont *, chk_malloc(sizeof *cont)); |