Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 3a5bbee679ea7f1d6c651b854513b1ca602fef478d34652f8c9e3065eea9a3c7
Ticket: 00cced7b87a26e570cc5436e386c42225c46dfba
Incorrect handling of indices > 0x80000000 in byte compiler (64-bit Tcl)
User & Date: apnadkarni on 2022-11-02 02:55:34
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-markdown"
  4. comment changed to:
    See the disassembly below:
    
    ```
    % tcl::unsupported::disassemble script {lindex $l 0x100000000}
    ByteCode 0xffffffffebbdeec8, refCt 1, epoch 20, interp 0xffffffffebb11ca8 (epoch 20)
      Source "lindex $l 0x100000000"
      Cmds 1, src 21, inst 9, litObjs 1, aux 0, stkDepth 1, code/src 0.00
      Commands 1:
          1: pc 0-7, src 0-20
      Command 1: "lindex $l 0x100000000"
        (0) push1 0         # "l"
        (2) loadStk
        (3) listIndexImm -1
        (8) done
    ```
    
    Indices > 0x80000000 result in the listIndexImm operand being -1
    
    As an example, 
    
    ```
    % lindex [lseq 0x100000008] 0x100000000
    %
    ```
    
    returns an empty string.
    
  5. foundin changed to: "9.0"
  6. is_private changed to: "0"
  7. login: "apnadkarni"
  8. priority changed to: "5 Medium"
  9. resolution changed to: "None"
  10. severity changed to: "Important"
  11. status changed to: "Open"
  12. submitter changed to: "apnadkarni"
  13. subsystem changed to: "47. Bytecode Compiler"
  14. title changed to:
    Incorrect handling of indices > 0x80000000 in byte compiler (64-bit Tcl)
    
  15. type changed to: "Bug"