Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 901c1085fd7ee08af25be7bfcdd37dd58e1f462c9ae61602a14d5f67a5f6a076
Ticket: fa00fbbbabe2d77904ac0086884d5debf9c529a5
lseq / lindex discrepancies
User & Date: griffin on 2023-04-16 23:02:10
Changes

  1. icomment:
    The last issue is a general problem with byte compiler and index values. This comment from tclUtil.c explains:
    
     * TclIndexEncode --
     *
     *      Parse objPtr to determine if it is an index value. Two cases
     *	are possible.  The value objPtr might be parsed as an absolute
     *	index value in the C signed int range.  Note that this includes
     *	index values that are integers as presented and it includes index
     *      arithmetic expressions. The absolute index values that can be
     *	directly meaningful as an index into either a list or a string are
     *	those integer values >= TCL_INDEX_START (0)
     *	and < INT_MAX.
     *      The largest string supported in Tcl 8 has bytelength INT_MAX.
     *      This means the largest supported character length is also INT_MAX,
     *      and the index of the last character in a string of length INT_MAX
     *      is INT_MAX-1.
    
    It looks like this was missed when moving from 32-bit indices to 64-bit indices.
    
  2. login: "griffin"
  3. mimetype: "text/plain"