diff options
author | dgp <dgp@users.sourceforge.net> | 2011-07-15 17:53:57 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2011-07-15 17:53:57 (GMT) |
commit | c4e6823834ff315ac0cbc1dab5f3749482696aab (patch) | |
tree | 6886898b0e62f4bbbf4ba87fc0019845618be529 /generic/tclCompile.c | |
parent | aa1a72b31337d3fa30a90286eac8374c296691be (diff) | |
parent | a5cd0c254693b12d78c39cc4cddc07745e121668 (diff) | |
download | tcl-c4e6823834ff315ac0cbc1dab5f3749482696aab.zip tcl-c4e6823834ff315ac0cbc1dab5f3749482696aab.tar.gz tcl-c4e6823834ff315ac0cbc1dab5f3749482696aab.tar.bz2 |
Avoid segfaults when RecordByteCodeStats() is called in a deleted interp.
Diffstat (limited to 'generic/tclCompile.c')
-rw-r--r-- | generic/tclCompile.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/generic/tclCompile.c b/generic/tclCompile.c index 7f11e0e..6d64feb 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -4093,6 +4093,11 @@ RecordByteCodeStats( Interp *iPtr = (Interp *) *codePtr->interpHandle; register ByteCodeStats *statsPtr = &(iPtr->stats); + if (iPtr == NULL) { + /* Avoid segfaulting in case we're called in a deleted interp */ + return; + } + statsPtr->numCompilations++; statsPtr->totalSrcBytes += (double) codePtr->numSrcBytes; statsPtr->totalByteCodeBytes += (double) codePtr->structureSize; |