Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 3337f043f76303c263134646c84fd46ddf45333b
Ticket: 218745ffffffffffffffffffffffffffffffffff
Use of ByteArray object type is buggy (PATCH)
User & Date: nobody on 2000-10-26 01:04:52
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 1975 Bug
    Version: 8.1
    SubmitDate: '1999-05-04'
    LastModified: '1999-05-14'
    Severity: SER
    Status: Released
    Submitter: pat
    ChangedBy: stanton
    RelatedBugIDs: 2047
    OS: Windows NT
    Machine: X86
    FixedDate: '1999-05-07'
    FixedInVersion: 8.1.1
    ClosedDate: '2000-10-25'
    
    
    Name:
    
    Matt Newman
    
    
    
    Extensions:
    
    BLT, INCRTCL, TCLX, TNSS, TRF, TCLODBC, SENTCL, LDAP.....
    
    
    
    CustomShell:
    
    Not yet - at last tcl has a binary safe "after" command.
    
    
    
    Comments:
    
    The bug is that when dup'ing the internal rep of a ByteArray it doesn't
    
        set the new objects typePtr - which remains NULL so that when append is
    
        called the object is assumed to contain no data.
    
    
    
    ReproducibleScript:
    
    set hdr [binary format cc 0 0316]
    
        set buf hellomatt
    
        
    
        set data $hdr
    
        #UNCOMMENT TO MAKE WORK!!!#string length $data
    
        append data $buf
    
        
    
        if {[string length $data] == 11} {
    
            tclLog GOOD
    
        } else {
    
            tclLog "BAD: expected 11, got [string length $data]"
    
        }
    
    
    
    ObservedBehavior:
    
    Length is returned as 9 not 11. In fact if you uncomment the string
    
        length $data line it forces an update of the internal string rep then
    
        the script succeeds.
    
    
    
    DesiredBehavior:
    
    Length of 11
    
    
    
    Patch:
    
    diff -c -r1.1.1.2 tclBinary.c
    
    *** tclBinary.c 1999/05/02 23:44:25     1.1.1.2
    
    --- tclBinary.c 1999/05/03 13:37:47
    
    ***************
    
    *** 457,462 ****
    
    --- 457,463 ----
    
          memcpy((VOID *) copyArrayPtr->bytes, (VOID *) srcArrayPtr->bytes,
    
                (size_t) length);
    
          SET_BYTEARRAY(copyPtr, copyArrayPtr);
    
    +     copyPtr->typePtr = &tclByteArrayType;
    
      }
    
      ♀
    
      /*
    
    
    
    PatchFiles:
    
    generic/tclBinary.c
    
    
    
    
    
    
    
  4. foundin changed to: "obsolete: 8.1"
  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: "Use of ByteArray object type is buggy (PATCH)"
  11. type changed to: "Bug"