Tcl Source Code

Changes On Branch bug-3392070
Login

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

Changes In Branch bug-3392070 Excluding Merge-Ins

This is equivalent to a diff from df6fb9a914 to eb11820a8e

2011-08-17
12:19
3392070 More complete prevention of Tcl_Obj reference cycles when producing an intrep of ByteCode. check-in: ed21e85c21 user: dgp tags: trunk
12:15
3392070 More complete prevention of Tcl_Obj reference cycles when producing an intrep of ByteCode. Closed-Leaf check-in: 9eeb666324 user: dgp tags: mistake
2011-08-16
19:49
3392070 More complete prevention of Tcl_Obj reference cycles when producing an intrep of ByteCode. Closed-Leaf check-in: eb11820a8e user: dgp tags: bug-3392070
16:04
Fixed the C99/C++ comments introduced by [8d3f0fb215] which break strict C89 compilers (AIX, cough, ... check-in: ca3ccdf1df user: andreask tags: trunk
14:04
Merge to feature branch check-in: fbcefff570 user: dkf tags: dkf-utf16-branch
14:03
Merge to feature branch check-in: 7db2c10d31 user: dkf tags: dkf-notifier-poll
13:55
Small changes to quell gcc warnings and make message generation less ugly. check-in: df6fb9a914 user: dkf tags: trunk
12:16
merge-mark check-in: 35b05b35d9 user: jan.nijtmans tags: trunk

Changes to ChangeLog.






1
2
3
4
5
6
7
1
2
3
4
5
6
7
8
9
10
11
12
+
+
+
+
+







2011-08-16  Don Porter  <[email protected]>

	* generic/tclCompile.c: [Bug 3392070] More complete prevention of
	Tcl_Obj reference cycles when producing an intrep of ByteCode.

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

	* generic/tclListObj.c (TclLindexList, TclLsetFlat): Silence warnings
	about (unreachable) cases of uninitialized variables.
	* generic/tclCmdIL.c (SelectObjFromSublist): Improve the generation of
	* generic/tclIndexObj.c (Tcl_ParseArgsObjv): messages through the use
	* generic/tclVar.c (ArrayStartSearchCmd):    of Tcl_ObjPrintf.

Changes to generic/tclCompile.c.

2445
2446
2447
2448
2449
2450
2451





2452



2453

2454
2455
2456
2457
2458
2459
2460
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460

2461
2462
2463
2464
2465
2466
2467
2468







+
+
+
+
+

+
+
+
-
+







    for (i = 0;  i < numLitObjects;  i++) {
	if (objPtr == envPtr->literalArrayPtr[i].objPtr) {
	    /*
	     * Prevent circular reference where the bytecode intrep of
	     * a value contains a literal which is that same value.
	     * If this is allowed to happen, refcount decrements may not
	     * reach zero, and memory may leak.  Bugs 467523, 3357771
	     *
	     * NOTE:  [Bugs 3392070, 3389764] We make a copy based completely
	     * on the string value, and do not call Tcl_DuplicateObj() so we
             * can be sure we do not have any lingering cycles hiding in
	     * the intrep.
	     */
	    int numBytes;
	    const char *bytes = Tcl_GetStringFromObj(objPtr, &numBytes);

	    codePtr->objArrayPtr[i] = Tcl_DuplicateObj(objPtr);
	    codePtr->objArrayPtr[i] = Tcl_NewStringObj(bytes, numBytes);
	    Tcl_IncrRefCount(codePtr->objArrayPtr[i]);
	    Tcl_DecrRefCount(objPtr);
	} else {
	    codePtr->objArrayPtr[i] = envPtr->literalArrayPtr[i].objPtr;
	}
    }