diff options
author | dgp <dgp@users.sourceforge.net> | 2011-07-15 17:56:06 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2011-07-15 17:56:06 (GMT) |
commit | ff87b46b5269cbd4def059244e47ec2db336e166 (patch) | |
tree | c42b201c8a8628a1db61a8fd97a3a30ab418c479 /generic/tclCompile.c | |
parent | f10d6c78e39de65787b2bb9652689feeca1b0b31 (diff) | |
parent | c4e6823834ff315ac0cbc1dab5f3749482696aab (diff) | |
download | tcl-ff87b46b5269cbd4def059244e47ec2db336e166.zip tcl-ff87b46b5269cbd4def059244e47ec2db336e166.tar.gz tcl-ff87b46b5269cbd4def059244e47ec2db336e166.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 8aedf95..ae633ea 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -4572,6 +4572,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; |