Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 6fa25739310fb7dd5c7ffe33f404f3174fe1c32e209d6d726e6bf6a61d51d769
Ticket: 26f1328a86863216c8fae28f55ff0e09135d5d35
sizeof(int) < sizeof(void*) -> Crash
User & Date: anonymous on 2022-01-12 13:00:35
Changes

  1. icomment:
    Some more information:
    
    The problem originates in JUMP_PEEPHOLE_F (tclExecute.c:317), where
    TclGetInt4AtPtr(pc+1)) is calculated and than added to pc in
    NEXT_INST_F (tclExecute.c:246).  The bytes at the incoming pc+1 are
    0xFF,0xFF,0xFD,0xBC, which is supposed to mean -580.
    
    The attached test program exercises this.  The result on Linux/amd64
    is
    
        $ gcc -o ts test-signed-tcl.c && ./ts
        12 -> U:0
        12U -> U:1
        -12 -> U:0
        int(bytes): -580 U:0
        ptr: 0x55c79ab8f135 + int(bytes) -> 0x55c79ab8eef1 (diff:-580)
    
    The result on Plan 9 (9front/amd64) is:
    
        term% pcc -o tsp test-signed-tcl.c && tsp
        12 -> U:0
        12U -> U:1
        -12 -> U:0
        int(bytes): -580 U:1
        ptr: 0x200028 + int(bytes) -> 0x1001FFDE4 (diff:4294966716)
    
  2. login: "anonymous"
  3. mimetype: "text/plain"
  4. username: "[email protected]"