summaryrefslogtreecommitdiffstats
path: root/generic/tclCompile.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclCompile.c')
-rw-r--r--generic/tclCompile.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/generic/tclCompile.c b/generic/tclCompile.c
index f29c54e..e281a0a 100644
--- a/generic/tclCompile.c
+++ b/generic/tclCompile.c
@@ -4012,6 +4012,11 @@ RecordByteCodeStats(codePtr)
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;