Artifacts Associated With Ticket 7179c6724cd38271
Ticket change [ab0b14dca9] (rid 229918) by sebres on 2024-08-12 12:48:06:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-fossil-wiki"
- comment initialized to:
Compilation of incr command (with immutable offset, as <code><i>INST_INCR_*_IMM</i></code>) seems to be broken on wide constant offset by int overflow. Non-compiled or dynamic offset (compiled as <code><i>INST_INCR_*</i></code> instructions without <code><i>_IMM</i></code> suffix) work as expected: <code><pre> % set i 0; incr i 0xffffff80 <b style="color:green;">4294967168</b> % set i 0; incr i 0xffffff81 <b style="color:red;">-127</b> % set i 0; incr i 0xffffffff <b style="color:red;">-1</b> % set i 0; incr i 0xffffffff <b style="color:red;">-1</b> % set i 0; set cmd incr; $cmd i 0xffffffff <b style="color:green;">4294967295</b> % set i 0; incr i [set x 0xffffffff] <b style="color:green;">4294967295</b> </pre></code> My fork doesn't have this bug, so I'll try to backport the fix.
- foundin initialized to: "8.5+"
- is_private initialized to: "0"
- login: "sebres"
- priority initialized to: "5 Medium"
- private_contact initialized to: "50e9528765c18296566374b3fde2df942c394efd"
- resolution initialized to: "None"
- severity initialized to: "Important"
- status initialized to: "Open"
- submitter initialized to: "sebres"
- subsystem initialized to: "47. Bytecode Compiler"
- title initialized to:
compiilation of incr command is broken on wide constant offset by int overflow
- type initialized to: "Bug"
Ticket change [656ba930cb] (rid 229919) by sebres on 2024-08-12 12:50:32:
- assignee changed to: "sebres"
- login: "sebres"
- mimetype: "text/plain"
- priority changed to: "7 High"
- resolution changed to: "Later"
Ticket change [a7d60599c7] (rid 229937) by sebres on 2024-08-12 13:39:02:
- assignee changed to: "nobody"
- closedate changed to: "2460535.06877421"
- closer changed to: "sebres"
- icomment:
Fixed: - 8.5 - [068a8b152e2da1e0]<br/> - 8.6 - [e2f55d60603a87a3]<br/> - 8.7/9.0 - [cbabbeed5105d882] / [8f8b3d2903776a4a]<br/>
- login: "sebres"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- title changed to:
compilation of incr command is broken on wide constant offset by int overflow
Ticket change [f8d2828063] (rid 229938) by sebres on 2024-08-12 13:54:03:
- closedate changed to: "2460535.07920403"
- icomment:
By the way, the fix was minimalistic, in opposite to my fix in fork, that uses safe `TclGetSignedIntFromObj` routine (tcl seems not to have yet), which wouldn't success by overflow, and since the code is full with Tcl?_?GetIntFromObj, maybe it'd be time for larger review (to prevent ugly unintended overflows like that everywhere).
- login: "sebres"
- mimetype: "text/x-markdown"
Ticket change [b7b5dda0ed] (rid 229939) by sebres on 2024-08-12 14:27:29:
- closedate changed to: "2460535.10242799"
- comment changed to:
Compilation of incr command (with immutable offset, as <code><i>INST_INCR_*_IMM</i></code>) seems to be broken on wide constant offset by int overflow. Non-compiled or dynamic offset (compiled as <code><i>INST_INCR_*</i></code> instructions without <code><i>_IMM</i></code> suffix) work as expected: <code><pre> % set i 0; incr i 0xffffff80 <b style="color:green;">4294967168</b> % set i 0; incr i 0xffffff81 <b style="color:red;">-127</b> % set i 0; incr i 0xffffffff <b style="color:red;">-1</b> % set i 0; set cmd incr; $cmd i 0xffffffff <b style="color:green;">4294967295</b> % set i 0; incr i [set x 0xffffffff] <b style="color:green;">4294967295</b> % set i 0; incr i 4294967169 <b style="color:red;">-127</b> % set i 0; incr i 4294967295 <b style="color:red;">-1</b> </pre></code> My fork doesn't have this bug, so I'll try to backport the fix.
- login: "sebres"
- mimetype: "text/plain"