Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: a54e946d874d110a689955de92cb4d47aeca5c3e
Ticket: 218419ffffffffffffffffffffffffffffffffff
Error in moving data from c++ to tcl
User & Date: nobody on 2000-10-26 00:57:20
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 5636 Bug
    Version: 8.2
    SubmitDate: '2000-05-23'
    LastModified: '2000-05-23'
    Severity: SER
    Status: Closed
    Submitter: techsupp
    ChangedBy: hobbs
    RelatedBugIDs: 3466
    OS: Windows NT
    OSVersion: NT 4.0 sp 5
    Machine: IBM 300PL / Pentium-II 400MHz
    FixedDate: '2000-10-25'
    ClosedDate: '2000-05-23'
    
    
    Name:
    Hillel Avni
    
    ReproducibleScript:
    in c++:
    ----
    int t_mm()
    {
    char *buf = new char[100];
    *(int *) buf = 0xd0800000; //or 0xd0900000 or 0xd0a00000 or 0xd0b00000
    Tcl_Obj *t = Tcl_NewObj();
    Tcl_AppendToObj (t, buf, 8);
    Tcl_SetObjResult(interp, t);
    }
    
    
    in tcl:
    ---
    set a [t_mm]
    binary scan $a H* b
    puts $b
    
    ObservedBehavior:
    input to t_mm, i.e - buf    |   output of tcl
    -----------------+-----------
    0xd0700000                    |   0xd0700000
    0xd0800000                    |   0x00000000
    0xd0900000                    |   0x10000000
    0xd0a00000                    |   0x20000000
    0xd0b00000                    |   0x30000000
    0xd0c00000                    |    0xd0c00000
    
    DesiredBehavior:
    Same value on both raws.
    
    
    
    This is prone to error.  The user should create these byte
    arrays with the Tcl_GetByteArrayFromObj and other Tcl ByteArray
    C functions to maintain integrity (avoid UTF translation).
    Also note the signed int dangers in bug report 3466. 
    -- 05/23/2000 hobbs
    
  4. foundin changed to: "obsolete: 8.2"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "69. Other"
  10. title changed to: "Error in moving data from c++ to tcl"
  11. type changed to: "Bug"