summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2016-05-06 16:03:15 (GMT)
committerdgp <dgp@users.sourceforge.net>2016-05-06 16:03:15 (GMT)
commit024bab411658378d39fd0d8a6ce363b72cdebacd (patch)
tree697e3bc003c0d5b5ba5962d5bf63c90957d5f036 /generic
parent8e5a574ac054782c904f88a1fe3af0eb54a42f1e (diff)
downloadtcl-024bab411658378d39fd0d8a6ce363b72cdebacd.zip
tcl-024bab411658378d39fd0d8a6ce363b72cdebacd.tar.gz
tcl-024bab411658378d39fd0d8a6ce363b72cdebacd.tar.bz2
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.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclAssembly.c3
1 files changed, 3 insertions, 0 deletions
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;