|
2020-05-13
| ||
| 20:33 | • Closed ticket [c11e0c5ce4]: Regression in Tcl_UtfCharComplete plus 6 other c... artifact: 4e7c0f38a9 user: jan.nijtmans | |
|
2020-04-23
| ||
| 11:31 | Fix [27944a3661]: Taming test utf-6.88 Fix [c11e0c5ce4]: Regression in Tcl_UtfCharComplete Fix [1b1f... check-in: 5c322bbd51 user: jan.nijtmans tags: core-8-6-branch | |
|
2020-04-21
| ||
| 10:19 | • Ticket [c11e0c5ce4] Regression in Tcl_UtfCharComplete status still Open with... artifact: 06d3b88ae3 user: jan.nijtmans | |
|
2020-04-20
| ||
| 15:27 | • Ticket [c11e0c5ce4]: 4 changes artifact: 46ab521d30 user: jan.nijtmans | |
| 15:20 | Proposed fix for [c11e0c5ce4]: Regression in Tcl_UtfCharComplete. check-in: 21362ee023 user: jan.nijtmans tags: bug-c11e0c5ce4 | |
|
2020-04-19
| ||
| 10:17 | • New ticket [c11e0c5ce4] Regression in Tcl_UtfCharComplete. artifact: 75979458ab user: jan.nijtmans | |
Regression in Tcl_UtfCharComplete
So, there is no test-case yet proving this, I'll come back too this ticket as soon as [27944a3661] is fixed.
5c322bbd51Fix [27944a3661]: Taming test utf-6.88 Fix [c11e0c5ce4]: Regression in Tcl_UtfCharComplete Fix [1b1f5f0b53]: Tcl_UtfNext incompatibility in Tcl 8.6.10 check-in2020-04-23 11:31:4721362ee023Proposed fix for [c11e0c5ce4]: Regression in Tcl_UtfCharComplete. check-in2020-04-20 15:20:55
Proposed fix in: [21362ee023f0b464]. More testing needed, I'm not 100% sure yet this is what we want. Still need to add more explanation here, why the current core-8-6-branch situation is wrong ....
OK, the promised explanation. The invariant is that Tcl_UtfCharComplete(src, TCL_UTF_MAX) should always return true. Since TCL_UTF_MAX is the maximum number of bytes Tcl_UtfToUniChar() can advance, supplying a buffer of TCL_UTF_MAX bytes should be enough for Tcl_UtfToUniChar() to advance. This means that the table used by Tcl_UtfCharComplete() can not have any table entry with a value > TCL_UTF_MAX.
Well, I made the same mistake in the TIP #542 implementation. I corrected that in commit [5f382f20565ff8ed] (together with another small improvement, handling byte C1 as invalid).
There's another small cornercase, missed in the TIP #542 implementation. If an extension is compiled with TCL_UTF_MAX=4 while Tcl is built with TCL_UTF_MAX=3, then it might happen that the extension calls Tcl_UtfCharComplete() which then might give the wrong result. For Tcl_UtfToUniChar() special stub entries are created for this purpose, but for Tcl_UtfCharComplete() there are not separate stub entries for TCL_UTF_MAX=3 and TCL_UTF_MAX=4. The easiest fix is supplying a macro for this corner-case. Fixed here: [8d2927e1c43e9c83]
So, let's fix [27944a3661] first, then I'll continue handling this for core-8-6-branch.
Since in core-8-6-branch, Tcl_UtfPrev() and Tcl_UtfNext() now maximum jump TCL_UTF_MAX bytes, the regression mentioned in this ticket is fixed. A little bit different than I thought .... but OK. So, closing.