Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: a3f2bdfb874fb88d42b563c1480f1a9b7e1af65614bf40d4921d0309ef9bece8
Ticket: 84a5355235e676b42ec000f1289fe03ce8ea824c
[expr {(-549755813888 >> 32) & 0xFF}]
User & Date: chrstphrchvz on 2023-08-13 14:49:17
Changes

  1. icomment:
    In the case for <tt>INST_RSHIFT</tt> in <tt>TEBCresume()</tt> (tclExecute.c line 6080 on core-8-branch):
    <pre>
    		    /*
    		     * Quickly force large right shifts to 0 or -1.
    		     */<br />
    		    if (w2 &gt;= (Tcl_WideInt)(CHAR_BIT*sizeof(long))) {
    </pre>
    
    Changing <tt>sizeof(long)</tt> to <tt>sizeof(Tcl_WideInt)</tt> appears to fix this issue; I believe that is the appropriate fix since TIP 484 means 32-bit long is no longer used for Tcl integer values. I have not looked for whether the same fix is needed elsewhere for similar issues.
    
    I suggest that a test case for this issue be added to expr.test (only the right shift is important, not the bitwise AND).
    
  2. login: "chrstphrchvz"
  3. mimetype: "text/x-fossil-wiki"