Tcl Source Code

Check-in [a6aa5be5b7]
Login

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

Overview
Comment:Fix: Removed C99ism (in-block variable declaration) from commit [39f6ebe301] which prevents building with non-gcc compilers, notably AIX, HPUX, Solaris, MSVC6, possibly others.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-5-branch
Files: files | file ages | folders
SHA1: a6aa5be5b70913851558edf57e24390906bf8e80
User & Date: andreask 2012-02-17 17:12:32
References
2012-02-17
17:15
Merged core-8-5-branch segfault fix (commits [39f6ebe301] and [a6aa5be5b7]). check-in: 7135bc0716 user: andreask tags: trunk
Context
2012-02-17
21:17
[Bug 2233954] AIX: compile error, but don't do that for _WIN32 (doesn't work in VS10) check-in: fa683cad00 user: jan.nijtmans tags: core-8-5-branch
17:15
Merged core-8-5-branch segfault fix (commits [39f6ebe301] and [a6aa5be5b7]). check-in: 7135bc0716 user: andreask tags: trunk
17:12
Fix: Removed C99ism (in-block variable declaration) from commit [39f6ebe301] which prevents building... check-in: a6aa5be5b7 user: andreask tags: core-8-5-branch
15:14
bug fix: avoid segfaulting by deleted interp in RecordByteCodeStats check-in: 39f6ebe301 user: sebres tags: core-8-5-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tclCompile.c.

4087
4088
4089
4090
4091
4092
4093


4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105

void
RecordByteCodeStats(
    ByteCode *codePtr)		/* Points to ByteCode structure with info
				 * to add to accumulated statistics. */
{
    Interp *iPtr = (Interp *) *codePtr->interpHandle;


    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;
    statsPtr->totalByteCodeBytes += (double) codePtr->structureSize;
    statsPtr->currentSrcBytes += (double) codePtr->numSrcBytes;
    statsPtr->currentByteCodeBytes += (double) codePtr->structureSize;








>
>




|







4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107

void
RecordByteCodeStats(
    ByteCode *codePtr)		/* Points to ByteCode structure with info
				 * to add to accumulated statistics. */
{
    Interp *iPtr = (Interp *) *codePtr->interpHandle;
    register ByteCodeStats *statsPtr;

    if (iPtr == NULL) {
	/* Avoid segfaulting in case we're called in a deleted interp */
	return;
    }
    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;