Skip to content
Tcl Source Code History Of Ticket cb90038a63
Login

History Of Ticket cb90038a63

Artifacts Associated With Ticket cb90038a63

  1. Ticket change [e673a77b8e] (rid 198260) by chrstphrchvz on 2022-02-17 15:24:10:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-fossil-wiki"
    4. comment initialized to:
      This command (as does test expr-34.22) triggers signed integer overflow (undefined behavior) when <tt>long</tt> is 32-bit:
      
      <blockquote><pre>
      % ::tcl::mathop::% -0x80000000 3
      <span style="font-weight:bold">tcl/generic/tclExecute.c:6289:24:<span style="color:red"> runtime error: </span>signed integer overflow: 3 * -715827883 cannot be represented in type 'long int'</span>
      <span style="font-weight:bold">tcl/generic/tclExecute.c:6289:15:<span style="color:red"> runtime error: </span>signed integer overflow: -2147483648 - 2147483647 cannot be represented in type 'long int'</span>
      1
      </pre></blockquote>
      
      Similar issue for this command (and test expr-36.22) for 64-bit <tt>long long</tt>:
      
      <blockquote><pre>
      % ::tcl::mathop::% -0x8000000000000000 3
      <span style="font-weight:bold">tcl/generic/tclExecute.c:8547:23:<span style="color:red"> runtime error: </span>signed integer overflow: -3074457345618258603 * 3 cannot be represented in type 'long long int'</span>
      <span style="font-weight:bold">tcl/generic/tclExecute.c:8547:14:<span style="color:red"> runtime error: </span>signed integer overflow: -9223372036854775808 - 9223372036854775807 cannot be represented in type 'long long int'</span>
      1
      </pre></blockquote>
      
      The attached patch uses the corresponding unsigned types to accommodate overflow in these edge cases.
      
    5. foundin initialized to: "core-8-6-branch"
    6. is_private initialized to: "0"
    7. login: "chrstphrchvz"
    8. priority initialized to: "5 Medium"
    9. resolution initialized to: "None"
    10. severity initialized to: "Minor"
    11. status initialized to: "Open"
    12. submitter initialized to: "chrstphrchvz"
    13. subsystem initialized to: "48. Number Handling"
    14. title initialized to:
      signed integer overflow during expr-34.22, expr-36.22
      
    15. type initialized to: "Patch"
  2. Add attachment "cb90038a63.diff" [dbeda56373] (rid 198261) by chrstphrchvz on 2022-02-17 15:26:10.

  3. Ticket change [1631d54687] (rid 198435) by jan.nijtmans on 2022-02-23 15:50:38:

    1. assignee changed to: "jan.nijtmans"
    2. closedate changed to: "2459634.16016666"
    3. closer changed to: "jan.nijtmans"
    4. icomment:
      Fixed [42d07d1fe556c48a|here]
      
      Thanks for the report and the patch
      
    5. login: "jan.nijtmans"
    6. mimetype: "text/x-fossil-wiki"
    7. resolution changed to: "Fixed"
    8. status changed to: "Closed"