Tcl Source Code

Check-in [4ab8a5f225]
Login

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

Overview
Comment:Repair corruption in [string reverse] when string rep invalidation failed to also reset the bytes allocated for string rep to zero [Bug 3285472].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-5-branch
Files: files | file ages | folders
SHA1: 4ab8a5f225abbedee41df2adc76a1719ea9514e6
User & Date: dgp 2011-04-12 20:04:11
Context
2011-04-13
13:19
fix for [Bug 2662380], crash caused by appending to a variable with a write trace that unsets it check-in: c12fa286f4 user: mig tags: core-8-5-branch
2011-04-12
20:13
Test for [Bug 3285472]. Not buggy in trunk. check-in: 920b355f33 user: dgp tags: trunk
20:04
Repair corruption in [string reverse] when string rep invalidation failed to also reset the bytes al... check-in: 4ab8a5f225 user: dgp tags: core-8-5-branch
19:13
Fix incorrect date in Changelog entry. check-in: 2414390332 user: venkat tags: core-8-5-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.







1
2
3
4
5
6
7






2011-04-12  Venkat Iyer <[email protected]>

	* library/tzdata/Atlantic/Stanley: Update to Olson tzdata2011f

2011-04-06  Miguel Sofer  <[email protected]>

	* generic/tclExecute.c (TclCompEvalObj): earlier return if Tip280 
>
>
>
>
>
>







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

	* generic/tclStringObj.c:	Repair corruption in [string reverse]
	* tests/string.test:	when string rep invalidation failed to also
	reset the bytes allocated for string rep to zero [Bug 3285472].

2011-04-12  Venkat Iyer <[email protected]>

	* library/tzdata/Atlantic/Stanley: Update to Olson tzdata2011f

2011-04-06  Miguel Sofer  <[email protected]>

	* generic/tclExecute.c (TclCompEvalObj): earlier return if Tip280 

Changes to generic/tclStringObj.c.

2754
2755
2756
2757
2758
2759
2760

2761
2762
2763
2764
2765
2766
2767

	while (i < lastCharIdx) {
	    Tcl_UniChar tmp = source[lastCharIdx];
	    source[lastCharIdx--] = source[i];
	    source[i++] = tmp;
	}
	Tcl_InvalidateStringRep(objPtr);

	return objPtr;
    }

    bytes = TclGetString(objPtr);
    if (Tcl_IsShared(objPtr)) {
	char *dest;
	Tcl_Obj *resultPtr = Tcl_NewObj();







>







2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768

	while (i < lastCharIdx) {
	    Tcl_UniChar tmp = source[lastCharIdx];
	    source[lastCharIdx--] = source[i];
	    source[i++] = tmp;
	}
	Tcl_InvalidateStringRep(objPtr);
	stringPtr->allocated = 0;
	return objPtr;
    }

    bytes = TclGetString(objPtr);
    if (Tcl_IsShared(objPtr)) {
	char *dest;
	Tcl_Obj *resultPtr = Tcl_NewObj();

Changes to tests/string.test.

1604
1605
1606
1607
1608
1609
1610





1611
1612
1613
1614
1615
1616
1617
    string reverse $x
} \udead\ubeef
test string-24.11 {string reverse command - corner case} {
    set x \ubeef
    set y \udead
    string reverse $x$y
} \udead\ubeef






test string-25.1 {string is list} {
    string is list {a b c}
} 1
test string-25.2 {string is list} {
    string is list "a \{b c"
} 0







>
>
>
>
>







1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
    string reverse $x
} \udead\ubeef
test string-24.11 {string reverse command - corner case} {
    set x \ubeef
    set y \udead
    string reverse $x$y
} \udead\ubeef
test string-24.12 {string reverse command - corner case} {
    set x \ubeef
    set y \udead
    string is ascii [string reverse $x$y]
} 0

test string-25.1 {string is list} {
    string is list {a b c}
} 1
test string-25.2 {string is list} {
    string is list "a \{b c"
} 0

tools/configure became a regular file.