diff options
author | dgp <dgp@noemail.net> | 2011-07-15 17:50:20 (GMT) |
---|---|---|
committer | dgp <dgp@noemail.net> | 2011-07-15 17:50:20 (GMT) |
commit | dcdc6dfb0eaf1283864e20cdb713a5be076e7967 (patch) | |
tree | 8c97671615ef0ff14a25f3d36beda514f6319c5e /generic/tclCompile.c | |
parent | 669dbfa38d393ab98140babf03c400c335ce8bd9 (diff) | |
download | tcl-dcdc6dfb0eaf1283864e20cdb713a5be076e7967.zip tcl-dcdc6dfb0eaf1283864e20cdb713a5be076e7967.tar.gz tcl-dcdc6dfb0eaf1283864e20cdb713a5be076e7967.tar.bz2 |
Avoid segfaults when RecordByteCodeStats() is called in a deleted interp.
FossilOrigin-Name: 5313bef77feff7eb7f1e014636d156250e050315
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 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; |