Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: ab0b14dca98851267c6219c51126fea844848a5b29db15f763e82b82e00ee9d3
Ticket: 7179c6724cd38271a771343f80197b1fc57315ad
compilation of incr command is broken on wide constant offset by int overflow
User & Date: sebres on 2024-08-12 12:48:06
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-fossil-wiki"
  4. 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; 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.
    
  5. foundin changed to: "8.5+"
  6. is_private changed to: "0"
  7. login: "sebres"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "50e9528765c18296566374b3fde2df942c394efd"
  10. resolution changed to: "None"
  11. severity changed to: "Important"
  12. status changed to: "Open"
  13. submitter changed to: "sebres"
  14. subsystem changed to: "47. Bytecode Compiler"
  15. title changed to:
    compiilation of incr command is broken on wide constant offset by int overflow
    
  16. type changed to: "Bug"