Skip to content
Tcl Source Code History Of Ticket 1c60dca341
Login

History Of Ticket 1c60dca341

Artifacts Associated With Ticket 1c60dca341

  1. Ticket change [a7be3a81ab] (rid 198146) by chrstphrchvz on 2022-02-16 00:15:17:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-fossil-wiki"
    4. comment initialized to:
      UBSan (<tt>-fsanitize=signed-integer-overflow</tt>) errors for 32-bit <tt>long</tt> and 64-bit <tt>long long</tt>:
      
      <blockquote><pre>
      % set a -0x8000000000000001; incr a 1
      <span style="font-weight:bold">tcl/generic/tclObj.c:3576:6:<span style="color:red"> runtime error: </span>negation of -9223372036854775808 cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself</span>
      -9223372036854775808
      % set b -0x8000000000000001; incr b 0x7fffffff80000001
      <span style="font-weight:bold">tcl/generic/tclObj.c:3550:6:<span style="color:red"> runtime error: </span>negation of -2147483648 cannot be represented in type 'long int'; cast to an unsigned type to negate this value to itself</span>
      -2147483648
      </pre></blockquote>
      
      As with [89de498973], this can be avoided by negating before casting, and by subtracting from 0 (binary minus) to avoid compiler warnings for unary minus with unsigned operand (e.g. [https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-2-c4146|MSVC <tt>/W2</tt> warning C4146]). See attached patch.
      
    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 in Tcl_SetBignumObj()"
    15. type initialized to: "Patch"
  2. Add attachment "setbignumobj-sif.diff" [769cb802b5] (rid 198147) by chrstphrchvz on 2022-02-16 00:15:37.

  3. Ticket change [0042dbc24d] (rid 198178) by jan.nijtmans on 2022-02-16 16:12:12:

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