Artifacts Associated With Ticket 203792a48c
Ticket change [48bb1e2e08] (rid 213606) by chrstphrchvz on 2023-04-22 08:05:33:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-fossil-wiki"
- comment initialized to:
Encountered during cmdAH.test and encoding.test for Tcl built with <tt>-fsanitize=shift-base</tt>: <blockquote><pre> <b>generic/tclEncoding.c:2779:27: <span style="color:firebrick">runtime error:</span> left shift of 255 by 24 places cannot be represented in type 'int' </b> </pre></blockquote> Avoid by casting to unsigned before shifting: <blockquote><pre> --- generic/tclEncoding.c.orig +++ generic/tclEncoding.c @@ -2774,9 +2774,9 @@ Utf32ToUtfProc( int prev = ch; if (flags & TCL_ENCODING_LE) { <span style="color:firebrick">- ch = (src[3] & 0xFF) << 24 | (src[2] & 0xFF) << 16 | (src[1] & 0xFF) << 8 | (src[0] & 0xFF);</span> <span style="color:green">+ ch = <b>(unsigned int)</b>(src[3] & 0xFF) << 24 | (src[2] & 0xFF) << 16 | (src[1] & 0xFF) << 8 | (src[0] & 0xFF);</span> } else { <span style="color:firebrick">- ch = (src[0] & 0xFF) << 24 | (src[1] & 0xFF) << 16 | (src[2] & 0xFF) << 8 | (src[3] & 0xFF);</span> <span style="color:green">+ ch = <b>(unsigned int)</b>(src[0] & 0xFF) << 24 | (src[1] & 0xFF) << 16 | (src[2] & 0xFF) << 8 | (src[3] & 0xFF);</span> } if (HIGH_SURROGATE(prev) && !LOW_SURROGATE(ch)) { /* Bug [10c2c17c32]. If Hi surrogate not followed by Lo surrogate, finish 3-byte UTF-8 */ </pre></blockquote> - foundin initialized to: "core-8-branch"
- is_private initialized to: "0"
- login: "chrstphrchvz"
- priority initialized to: "5 Medium"
- private_contact initialized to: "6133eb3026f9b10aa9b7b48da92ae2834fc225b0"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "chrstphrchvz"
- subsystem initialized to: "44. UTF-8 Strings"
- title initialized to: "Avoid signed integer overflow in Utf32ToUtfProc()"
- type initialized to: "Patch"
Ticket change [caa8aaf160] (rid 213638) by jan.nijtmans on 2023-04-22 18:10:27:
- assignee changed to: "jan.nijtmans"
- closedate changed to: "2460057.25725707"
- closer changed to: "jan.nijtmans"
- icomment: "Thanks for the fix!. Closing"
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Closed"