Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: e4fd0389160cfae8ae1e73cd5659983b2de457f7f19734d0f23cabec3ee36248
Ticket: 44452e2c5522c3e81d4ab6bcbd05fae0ad4c6d98
indexObj.test failures on i386
User & Date: chrstphrchvz on 2023-05-07 15:16:02
Changes

  1. icomment:
    I would say these failures are because <tt>endValue</tt> in <tt>GetWideForIndex()</tt> and <tt>GetEndOffsetFromObj()</tt> is <tt>size_t</tt>, i.e. 32-bit unsigned, and must be widened to <tt>Tcl_WideInt</tt> in this statement in <tt>GetEndOffsetFromObj()</tt>:
    <pre>
    	/* Different signs, sum cannot overflow */
    	*widePtr = endValue + offset + 1;
    </pre>
    The result of this statement is stored in <tt>wide</tt> in <tt>Tcl_GetIntForIndex()</tt> which then gets capped to <tt>INT_MAX</tt> for these failing tests.
    
    But trying <tt>(ssize_t)endValue</tt> just in the statement above breaks init.tcl, so maybe there is more to the problem.
    
    And rather than trying to treat <tt>endValue</tt> as signed in one spot, maybe it can be made <tt>Tcl_WideInt</tt>, as done by TIP 660 for 9.0; I think that might be appropriate since <tt>endValue</tt> comes from either a <tt>Tcl_WideInt</tt> (from a Tcl value) or an <tt>int</tt>.
    
  2. login: "chrstphrchvz"
  3. mimetype: "text/x-fossil-wiki"