Tcl Source Code

Check-in [f57b5ba48d]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

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

Overview
Comment:3484402 Correct Off-By-One error appending unicode. Thanks to Poor Yorick. Also corrected test for when growth is needed.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-4-branch
Files: files | file ages | folders
SHA1: f57b5ba48d247bced08a60b5638a39036cff4bdf
User & Date: dgp 2012-02-09 14:57:14
Context
2012-02-29
21:17
[Bug 3466099] BOM in Unicode check-in: e17fc0e07b user: jan.nijtmans tags: core-8-4-branch
2012-02-19
15:21
[Bug 3466099] BOM in Unicode check-in: f019af39bd user: jan.nijtmans tags: bug-3466099
2012-02-09
15:00
3484402 Correct Off-By-One error appending unicode. Thanks to Poor Yorick. Also corrected test for w... check-in: f43b43900f user: dgp tags: core-8-5-branch
14:57
3484402 Correct Off-By-One error appending unicode. Thanks to Poor Yorick. Also corrected test for w... check-in: f57b5ba48d user: dgp tags: core-8-4-branch
2012-02-07
20:28
3484402 Correct Off-By-One error appending unicode. Thanks to Poor Yorick. Also converted some memc... Closed-Leaf check-in: ba9a1d9ddb user: dgp tags: bug-3484402
2012-02-06
17:21
3484621 Invalidate bytecode when exec traces are added/removed from compiled cmd. check-in: 4b0a6f7864 user: dgp tags: core-8-4-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.







1
2
3
4
5
6
7





2012-02-06  Don Porter  <[email protected]>

	* generic/tclCmdMZ.c:	[Bug 3484621] Invalidate bytecode when exec
	* tests/trace.test:	traces are added/removed from compiled cmd.

2012-02-02  Jan Nijtmans  <[email protected]>

>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
2012-02-09  Don Porter  <[email protected]>

	* generic/tclStringObj.c:	[Bug 3484402] Correct Off-By-One
	error appending unicode. Thanks to Poor Yorick. Also corrected test
	for when growth is needed. 

2012-02-06  Don Porter  <[email protected]>

	* generic/tclCmdMZ.c:	[Bug 3484621] Invalidate bytecode when exec
	* tests/trace.test:	traces are added/removed from compiled cmd.

2012-02-02  Jan Nijtmans  <[email protected]>

Changes to generic/tclStringObj.c.

1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
     * modest increase.  See the "TCL STRING GROWTH ALGORITHM" comment at
     * the top of this file for an explanation of this growth algorithm.
     */

    numChars = stringPtr->numChars + appendNumChars;
    stringCheckLimits(numChars);

    if (STRING_UALLOC(numChars) >= stringPtr->uallocated) {
	/*
	 * Protect against case where unicode points into the existing
	 * stringPtr->unicode array.  Force it to follow any relocations
	 * due to the reallocs below.
	 */
	int offset = -1;
	if (unicode >= stringPtr->unicode && unicode <= stringPtr->unicode
		+ 1 + stringPtr->uallocated / sizeof(Tcl_UniChar)) {
	    offset = unicode - stringPtr->unicode;
	}

	GrowUnicodeBuffer(objPtr, numChars);
	stringPtr = GET_STRING(objPtr);

	/* Relocate unicode if needed; see above. */






|







|







1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
     * modest increase.  See the "TCL STRING GROWTH ALGORITHM" comment at
     * the top of this file for an explanation of this growth algorithm.
     */

    numChars = stringPtr->numChars + appendNumChars;
    stringCheckLimits(numChars);

    if (STRING_UALLOC(numChars) > stringPtr->uallocated) {
	/*
	 * Protect against case where unicode points into the existing
	 * stringPtr->unicode array.  Force it to follow any relocations
	 * due to the reallocs below.
	 */
	int offset = -1;
	if (unicode >= stringPtr->unicode && unicode <= stringPtr->unicode
		+ stringPtr->uallocated / sizeof(Tcl_UniChar)) {
	    offset = unicode - stringPtr->unicode;
	}

	GrowUnicodeBuffer(objPtr, numChars);
	stringPtr = GET_STRING(objPtr);

	/* Relocate unicode if needed; see above. */