From b87ec263c780440f2e79ab29f3dea7a4bf02ba1d Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 6 May 2016 16:03:15 +0000 Subject: Bug fix. Have to arrange to only close a catch once. After the space has been returned to placeholder values, closing with them as data leads to memory corruption. There's probably a better fix available because the error here feels like it's rooted somewhere else, having us continue to check values we ought to know have already been closed. --- generic/tclAssembly.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/generic/tclAssembly.c b/generic/tclAssembly.c index 6d5676b..d02721d 100644 --- a/generic/tclAssembly.c +++ b/generic/tclAssembly.c @@ -3984,6 +3984,9 @@ UnstackExpiredCatches( while (catchDepth > bbPtr->catchDepth) { --catchDepth; + if (catches[catchDepth] == NULL) { + continue; + } range = envPtr->exceptArrayPtr + catchIndices[catchDepth]; range->numCodeBytes = bbPtr->startOffset - range->codeOffset; catches[catchDepth] = NULL; -- cgit v0.12