|
2024-08-25
| ||
| 07:30 | Merge [f4d16ada5190a2d1]: Fix [4e38c347a4]: Changed contract for Tcl_UtfN(case)cmp in Tcl 8.7. check-in: 3e36f3fe56 user: pooryorick tags: unchained, INCOMPATIBLE_LICENSE | |
|
2024-01-10
| ||
| 21:22 | • Closed ticket [4e38c347a4]: Changed contract for Tcl_UtfN(case)cmp in Tcl 8.7</i... artifact: 921c64a2f0 user: jan.nijtmans | |
| 21:01 | Fix [4e38c347a4] Changed contract for Tcl_UtfN(case)cmp in Tcl 8.7 check-in: 45db2932ba user: jan.nijtmans tags: core-8-branch | |
| 15:12 | Fix [4e38c347a4]: Changed contract for Tcl_UtfN(case)cmp in Tcl 8.7 check-in: f4d16ada51 user: jan.nijtmans tags: trunk, main | |
|
2024-01-09
| ||
| 23:35 | • Ticket [4e38c347a4] Changed contract for Tcl_UtfN(case)cmp in Tcl 8.7 status... artifact: 52dd8368ac user: jan.nijtmans | |
| 23:22 | • New ticket [4e38c347a4]. artifact: c3d86ff8cb user: jan.nijtmans | |
Changed contract for Tcl_UtfN(case)cmp in Tcl 8.7
Closed / Fixed4e38c347a4ff74fb800262925b0e0994c99ef28dCreated 3 years agoUpdated 3 years ago
Descriptionwiki2024-01-09 23:22:29
The functions Tcl_UtfN(case)cmp in Tcl 8.6 expect the "n" parameter to count in UTF-16 units, but in 8.7/9.0 those functions count in UTF-32. As long as the string doesn't contain codepoints > U+FFFF this won't be noticed, but it's not correct.
Example code from tcldom (domxslt.c line 2312-2315):
lenA = Tcl_NumUtfChars (strA, -1);
lenB = Tcl_NumUtfChars (strB, -1);
len = (lenA < lenB ? lenA : lenB);
rc = Tcl_UtfNcasecmp (strA, strB, len);
There's nothing wrong with this code but if Tcl_UtfNcasecmp() doesn't use the same "len" metrics as Tcl_NumUtfChars() this won't work as expected.
Solution: Move Tcl_UtfN(case)cmp to new stub entries, and put back the original Tcl 8.6 versions of those functions. That restores full binary compatibility between 8.6 and 8.7
Referenced by3
3e36f3fe56Merge [f4d16ada5190a2d1]: Fix [4e38c347a4]: Changed contract for Tcl_UtfN(case)cmp in Tcl 8.7. check-in2024-08-25 07:30:3245db2932baFix [4e38c347a4] Changed contract for Tcl_UtfN(case)cmp in Tcl 8.7 check-in2024-01-10 21:01:29f4d16ada51Fix [4e38c347a4]: Changed contract for Tcl_UtfN(case)cmp in Tcl 8.7 check-in2024-01-10 15:12:39
jan.nijtmans Ticket [4e38c347a4]: 3 changes
[History diff]2024-01-09 23:35:21
jan.nijtmanswiki2024-01-10 21:22:44
Fixed now in core-8-branch and trunk
Log in (anonymous is fine) to add a comment.