Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 8887bbfcdc96c9d9bd7e28bae9b2d0c00e8a7cd8
Ticket: 635200ffffffffffffffffffffffffffffffffff
string obj unicode efficiency
User & Date: vincentdarley on 2002-11-07 21:51:46
Changes

  1. assignee changed to: "nijtmans"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    The following code:
    
        int len;
        Tcl_Obj *objPtr;
        objPtr = Tcl_NewObj();
        Tcl_AppendToObj(objPtr, "foobar\n", 7);
        Tcl_GetUnicodeFromObj(objPtr, &len);
        Tcl_AppendToObj(objPtr, "foobar\n", 7);
        Tcl_GetUnicodeFromObj(objPtr, &len);
        Tcl_SetObjLength(objPtr, 0);
        Tcl_AppendToObj(objPtr, "foobar\n", 7);
    
    results in a crash because objPtr->bytes == NULL and
    Tcl_AppendToObj tries to copy into it.  The crash
    occurs in AppendUtfToUtfRep here:
    
        memcpy((VOID *) (objPtr->bytes + oldLength), (VOID
    *) bytes,
        (size_t) numBytes);
    
    I don't know enough to be able to attempt to reproduce
    this in pure Tcl, but my implementation of tip113 ran
    into this problem...
    
    
  4. foundin changed to: "obsolete: 8.4.1"
  5. priority changed to: "7 High"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "vincentdarley"
  9. subsystem changed to: "44. UTF-8 Strings"
  10. title changed to: "crash in string object manipulation"
  11. type changed to: "Bug"