Artifacts Associated With Ticket c11e0c5ce426ac09
Ticket change [75979458ab] (rid 182069) by jan.nijtmans on 2020-04-19 10:17:41:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-fossil-wiki"
- comment initialized to:
Starting with commit [c18f3f5870fc0b20], The original contract of Tcl_UtfCharComplete() is broken. It's easy to fix, and the fix has the fix for [27944a3661] as prequisite. So, there is no test-case yet proving this, I'll come back too this ticket as soon as [27944a3661] is fixed.
- foundin initialized to: "8.6 c18f3f5870fc0b20]"
- is_private initialized to: "0"
- login: "jan.nijtmans"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "jan.nijtmans"
- subsystem initialized to: "44. UTF-8 Strings"
- title initialized to: "Regression in Tcl_UtfCharComplete"
- type initialized to: "Bug"
Ticket change [46ab521d30] (rid 182135) by jan.nijtmans on 2020-04-20 15:27:08:
- assignee changed to: "jan.nijtmans"
- icomment:
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 ....
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
Ticket change [06d3b88ae3] (rid 182179) by jan.nijtmans on 2020-04-21 10:19:25:
- icomment:
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.
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [4e7c0f38a9] (rid 183384) by jan.nijtmans on 2020-05-13 20:33:10:
- closedate changed to: "2458983.35637458"
- closer changed to: "jan.nijtmans"
- icomment:
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.
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Closed"