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 | 885379e2ccc831e0b77425a16e57e9a41a703a8c (patch) | |
tree | 9316ab2b0905ab5213f9fdb4e24233f83563821b /generic/tclAssembly.c | |
parent | 8e5a574ac054782c904f88a1fe3af0eb54a42f1e (diff) | |
parent | 024bab411658378d39fd0d8a6ce363b72cdebacd (diff) | |
download | tcl-885379e2ccc831e0b77425a16e57e9a41a703a8c.zip tcl-885379e2ccc831e0b77425a16e57e9a41a703a8c.tar.gz tcl-885379e2ccc831e0b77425a16e57e9a41a703a8c.tar.bz2 |
Bug fix: Assembler dereferences a rogue pointer when unstacking an empty exception range.
Diffstat (limited to 'generic/tclAssembly.c')
-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; + } } /* |