diff options
author | Kevin B Kenny <kennykb@acm.org> | 2016-05-13 00:45:55 (GMT) |
---|---|---|
committer | Kevin B Kenny <kennykb@acm.org> | 2016-05-13 00:45:55 (GMT) |
commit | 675a0b7982d2ef03a79ee18e5f85aed8a2d34698 (patch) | |
tree | 9316ab2b0905ab5213f9fdb4e24233f83563821b /generic | |
parent | a1f0c2b5d2b3cfff326458d9a6f5f40168c01eb3 (diff) | |
parent | b87ec263c780440f2e79ab29f3dea7a4bf02ba1d (diff) | |
download | tcl-675a0b7982d2ef03a79ee18e5f85aed8a2d34698.zip tcl-675a0b7982d2ef03a79ee18e5f85aed8a2d34698.tar.gz tcl-675a0b7982d2ef03a79ee18e5f85aed8a2d34698.tar.bz2 |
Bug fix: Assembler dereferences a rogue pointer when unstacking an empty exception range.bug_3154ea2759
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclAssembly.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/generic/tclAssembly.c b/generic/tclAssembly.c index 6d5676b..f56da8f 100644 --- a/generic/tclAssembly.c +++ b/generic/tclAssembly.c @@ -3984,10 +3984,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; + } } /* |