Tcl Source Code

Check-in [002be5a1c3]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Avoid segfaults when RecordByteCodeStats() is called in a deleted interp.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-5-branch
Files: files | file ages | folders
SHA1: 002be5a1c38355e1c114155a45e245f00acc3099
User & Date: dgp 2011-07-15 17:53:57
Context
2011-07-19
19:26
3371644 Repair failure to properly handle (length == -1) in TclConvertElement(). check-in: 720e2e9c56 user: dgp tags: core-8-5-branch
2011-07-15
17:56
Avoid segfaults when RecordByteCodeStats() is called in a deleted interp. check-in: 609c597cb2 user: dgp tags: trunk
17:53
Avoid segfaults when RecordByteCodeStats() is called in a deleted interp. check-in: 002be5a1c3 user: dgp tags: core-8-5-branch
17:50
Avoid segfaults when RecordByteCodeStats() is called in a deleted interp. check-in: 5313bef77f user: dgp tags: core-8-4-branch
2011-07-14
02:39
3366265 Allocate proper size buffer for TclConvertElement() to write to. check-in: edfd80bc20 user: dgp tags: core-8-5-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.






1
2
3
4
5
6
7





2011-07-08  Donal K. Fellows  <[email protected]>

	* doc/http.n: [FRQ 3358415]: State what RFC defines HTTP/1.1.

2011-07-03  Donal K. Fellows  <[email protected]>

	* doc/FileSystem.3: Corrected statements about ctime field of 'struct
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
2011-07-15  Don Porter  <[email protected]>

	* generic/tclCompile.c: Avoid segfaults when RecordByteCodeStats()
	is called in a deleted interp.

2011-07-08  Donal K. Fellows  <[email protected]>

	* doc/http.n: [FRQ 3358415]: State what RFC defines HTTP/1.1.

2011-07-03  Donal K. Fellows  <[email protected]>

	* doc/FileSystem.3: Corrected statements about ctime field of 'struct

Changes to generic/tclCompile.c.

4088
4089
4090
4091
4092
4093
4094





4095
4096
4097
4098
4099
4100
4101
void
RecordByteCodeStats(
    ByteCode *codePtr)		/* Points to ByteCode structure with info
				 * to add to accumulated statistics. */
{
    Interp *iPtr = (Interp *) *codePtr->interpHandle;
    register ByteCodeStats *statsPtr = &(iPtr->stats);






    statsPtr->numCompilations++;
    statsPtr->totalSrcBytes += (double) codePtr->numSrcBytes;
    statsPtr->totalByteCodeBytes += (double) codePtr->structureSize;
    statsPtr->currentSrcBytes += (double) codePtr->numSrcBytes;
    statsPtr->currentByteCodeBytes += (double) codePtr->structureSize;








>
>
>
>
>







4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
void
RecordByteCodeStats(
    ByteCode *codePtr)		/* Points to ByteCode structure with info
				 * 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;
    }

    statsPtr->numCompilations++;
    statsPtr->totalSrcBytes += (double) codePtr->numSrcBytes;
    statsPtr->totalByteCodeBytes += (double) codePtr->structureSize;
    statsPtr->currentSrcBytes += (double) codePtr->numSrcBytes;
    statsPtr->currentByteCodeBytes += (double) codePtr->structureSize;