summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2016-05-13 00:46:23 (GMT)
committerKevin B Kenny <kennykb@acm.org>2016-05-13 00:46:23 (GMT)
commitc2cac5959d1949fd3e19ff977d28c9adfc872466 (patch)
tree1a4b44ff6ef696bc6e1dca3f607952bb4d6c55d8 /generic
parent8de5d7db9521a7768f47f53adfa6ef41a2072ca9 (diff)
parent675a0b7982d2ef03a79ee18e5f85aed8a2d34698 (diff)
downloadtcl-c2cac5959d1949fd3e19ff977d28c9adfc872466.zip
tcl-c2cac5959d1949fd3e19ff977d28c9adfc872466.tar.gz
tcl-c2cac5959d1949fd3e19ff977d28c9adfc872466.tar.bz2
Bug fix: Assembler dereferences a rogue pointer when unstacking an empty exception range.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclAssembly.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/generic/tclAssembly.c b/generic/tclAssembly.c
index 4ad31d2..8dd23a0 100644
--- a/generic/tclAssembly.c
+++ b/generic/tclAssembly.c
@@ -3982,10 +3982,12 @@ UnstackExpiredCatches(
while (catchDepth > bbPtr->catchDepth) {
--catchDepth;
- range = envPtr->exceptArrayPtr + catchIndices[catchDepth];
- range->numCodeBytes = bbPtr->startOffset - range->codeOffset;
- catches[catchDepth] = NULL;
- catchIndices[catchDepth] = -1;
+ if (catches[catchDepth] != NULL) {
+ range = envPtr->exceptArrayPtr + catchIndices[catchDepth];
+ range->numCodeBytes = bbPtr->startOffset - range->codeOffset;
+ catches[catchDepth] = NULL;
+ catchIndices[catchDepth] = -1;
+ }
}
/*