Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 71ffb9db1e656c7ca1ab8d7a3bc6c598e2591c38fdc0d43a00765c0521871bd2
Ticket: db36fa5122259be74d0ccadd102e076094703052
compiled lindex botches index artihmetic
User & Date: dgp on 2018-03-06 14:31:48
Changes

  1. icomment:
    Tcl 8.5 had two opcodes which took integer operands representing
    index values determined at compile time (OPERAND_IDX4).
    
    INST_LIST_INDEX_IMM
    INST_LIST_RANGE_IMM
    
    They agree on an encoding that the operand values
    
    -1, 0, 1, ..., INT_MAX
    
    stand for the same index values, while the operand values
    
    -2, -3, ..., INT_MIN
    
    stand for the index values
    
    end, end-1, ... end-(INT_MIN+2)
    
    If a command compiler encounters an index value known at
    compile time that doesn't fit in these supported ranges,
    it will have to emit the other instruction
    
    INST_LIST_INDEX
    
    or fallback to runtime invocation.
    
  2. login: "dgp"
  3. mimetype: "text/plain"