summaryrefslogtreecommitdiffstats
path: root/generic/tclAssembly.c
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)
commitb87ec263c780440f2e79ab29f3dea7a4bf02ba1d (patch)
tree697e3bc003c0d5b5ba5962d5bf63c90957d5f036 /generic/tclAssembly.c
parenta1f0c2b5d2b3cfff326458d9a6f5f40168c01eb3 (diff)
downloadtcl-b87ec263c780440f2e79ab29f3dea7a4bf02ba1d.zip
tcl-b87ec263c780440f2e79ab29f3dea7a4bf02ba1d.tar.gz
tcl-b87ec263c780440f2e79ab29f3dea7a4bf02ba1d.tar.bz2
Bug fix. Have to arrange to only close a catch once. After the spacebug_3154ea2759
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/tclAssembly.c')
-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;