diff options
author | dgp <dgp@noemail.net> | 2011-07-15 17:53:57 (GMT) |
---|---|---|
committer | dgp <dgp@noemail.net> | 2011-07-15 17:53:57 (GMT) |
commit | d48f94a81629b31db9d58bac1517516779d233c6 (patch) | |
tree | 6886898b0e62f4bbbf4ba87fc0019845618be529 | |
parent | dc354829331c2b525b2cb5da4c6748780f93a061 (diff) | |
parent | dcdc6dfb0eaf1283864e20cdb713a5be076e7967 (diff) | |
download | tcl-d48f94a81629b31db9d58bac1517516779d233c6.zip tcl-d48f94a81629b31db9d58bac1517516779d233c6.tar.gz tcl-d48f94a81629b31db9d58bac1517516779d233c6.tar.bz2 |
Avoid segfaults when RecordByteCodeStats() is called in a deleted interp.
FossilOrigin-Name: 002be5a1c38355e1c114155a45e245f00acc3099
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | generic/tclCompile.c | 5 |
2 files changed, 10 insertions, 0 deletions
@@ -1,3 +1,8 @@ +2011-07-15 Don Porter <dgp@users.sourceforge.net> + + * generic/tclCompile.c: Avoid segfaults when RecordByteCodeStats() + is called in a deleted interp. + 2011-07-08 Donal K. Fellows <dkf@users.sf.net> * doc/http.n: [FRQ 3358415]: State what RFC defines HTTP/1.1. 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; |