Skip to content
Tcl Source Code History Of Ticket 526717ffffffffffffffffffffffffffffffffff
Login

History Of Ticket 526717ffffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 526717ffffffffffffffffffffffffffffffffff

  1. Ticket change [d807739446] (rid 107372) by dgp on 2002-03-07 00:33:14:

    1. assignee initialized to: "dkf"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      
      Use of a Tcl_WideInt as a list index will
      shimmer it to an "int".
      
      On a 32-bit platform:
      % set index [expr {(wide(1)<<31) - 2}]
      2147483646
      % lindex {1 2 3} $index
      % incr index
      2147483647
      % incr index
      -2147483648
      
      Contrast with:
      % set index [expr {(wide(1)<<31) - 2}]
      2147483646
      % incr index
      2147483647
      % incr index
      2147483648
      
      It's worse on 64-bit platforms, where truncation
      is to an "int" even though Tcl_Integers are really
      longs:
      % set index [expr {wide(1)<<32}]
      4294967296
      % lindex {1 2 3} $index
      1
      % incr index
      4294967297
      % lindex {1 2 3} $index
      2
      
      So here, we don't lose range on the index values,
      but the indexing function "wraps around".
      
      Suspect trouble in TclGetIntForIndex
      
    4. foundin initialized to: "obsolete: 8.4a5"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "dgp"
    9. subsystem initialized to: "10. Objects"
    10. title initialized to: "list indexing corrupts wide ints"
    11. type initialized to: "Bug"
  2. Ticket change [565a88d666] (rid 94298) by dgp on 2002-03-07 07:36:26:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      More generally, any place that 
      Tcl_GetIntFromObj is called should be considered
      suspect.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  3. Ticket change [60b5f1a787] (rid 116042) by dkf on 2002-03-14 22:03:44:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      I supoose we could make Tcl_GetIntFromObj know about
      wideobjs...
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  4. Ticket change [7c709394b3] (rid 97079) by dkf on 2002-04-19 20:09:06:

    1. closedate changed to: "2002-04-19T13:09:06"
    2. closer changed to: "dkf"
    3. icomment:
      Logged In: YES 
      user_id=79902
      
      TclGetIntForIndex really ought to use 'long' and 'long*' not
      'int' and 'int*'...
      
      
    4. login: "dkf"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "dkf"