summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorsebres <sebres@users.sourceforge.net>2012-02-17 15:14:16 (GMT)
committersebres <sebres@users.sourceforge.net>2012-02-17 15:14:16 (GMT)
commit6df0a0efa540b67adb5a9d1bb2c5f58f8f656e23 (patch)
treeb463adefb1685caa1ec17e385435e5f4ef7d384e /generic
parent52c4fef3cfd97fa473a7cc98397cde9c6dde64a9 (diff)
downloadtcl-6df0a0efa540b67adb5a9d1bb2c5f58f8f656e23.zip
tcl-6df0a0efa540b67adb5a9d1bb2c5f58f8f656e23.tar.gz
tcl-6df0a0efa540b67adb5a9d1bb2c5f58f8f656e23.tar.bz2
bug fix: avoid segfaulting by deleted interp in RecordByteCodeStats
Diffstat (limited to 'generic')
-rw-r--r--generic/tclCompile.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/generic/tclCompile.c b/generic/tclCompile.c
index 6d64feb..59d1fbf 100644
--- a/generic/tclCompile.c
+++ b/generic/tclCompile.c
@@ -4091,12 +4091,11 @@ RecordByteCodeStats(
* to add to accumulated statistics. */
{
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;
}
+ register ByteCodeStats *statsPtr = &(iPtr->stats);
statsPtr->numCompilations++;
statsPtr->totalSrcBytes += (double) codePtr->numSrcBytes;