Artifacts Associated With Ticket 4789e18fcb
Ticket change [791cc4c907] (rid 198192) by chrstphrchvz on 2022-02-17 00:12:05:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-fossil-wiki"
- comment initialized to:
This command (equivalent to test obj-31.6) triggers signed integer overflow (undefined behavior), which the attached patch addresses: <blockquote><pre> % string index {} end--0x80000000 <span style="font-weight:bold">tcl/generic/tclUtil.c:3846:15:<span style="color:red"> runtime error: </span>negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself</span> <span style="font-weight:bold">tcl/generic/tclUtil.c:3770:26:<span style="color:red"> runtime error: </span>signed integer overflow: -1 + -2147483648 cannot be represented in type 'int'</span> </pre></blockquote> - foundin initialized to: "core-8-6-branch"
- is_private initialized to: "0"
- login: "chrstphrchvz"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "chrstphrchvz"
- subsystem initialized to: "13. Index Object"
- title initialized to: "signed integer overflow during obj-31.6"
- type initialized to: "Patch"
Add attachment "obj-31.6-overflow.diff" [597e2e82a2] (rid 198193) by chrstphrchvz on 2022-02-17 00:12:41.
Ticket change [1d5fee5fa6] (rid 198213) by chrstphrchvz on 2022-02-17 09:52:53:
- icomment:
Does the patch address the existing overflow concerns in <tt>SetEndOffsetFromAny()</tt>, or did those refer to something else (e.g. whether an overflow made sense as a useful result)?
- login: "chrstphrchvz"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [1037e654e5] (rid 198777) by jan.nijtmans on 2022-03-06 16:16:27:
- assignee changed to: "jan.nijtmans"
- closedate changed to: "2459645.1780999"
- closer changed to: "jan.nijtmans"
- icomment:
Thanks! Fixed now in [7913cae186572c3d]. This problem was already fixed in Tcl 8.7, thanks to [https://core.tcl-lang.org/tips/doc/trunk/tip/502.md|TIP #502]. Your patch does nothing more than eliminate the warnings using type-casts, it doesn't change the result for 8.6, so that's OK for 8.6.
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Closed"