Skip to content
Tcl Source Code History Of Ticket 218911
Login

History Of Ticket 218911

Artifacts Associated With Ticket 218911

  1. Ticket change [9430905c85] (rid 105943) by nobody on 2000-10-26 01:07:47:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      OriginalBugID: 2678 Bug
      Version: 8.2
      SubmitDate: '1999-08-31'
      LastModified: '1999-09-01'
      Severity: LOW
      Status: Released
      Submitter: techsupp
      ChangedBy: hobbs
      OS: Other
      Machine: NA
      FixedDate: '1999-09-01'
      ClosedDate: '2000-10-25'
      
      
      Name:
      
      Peter Spjuth
      
      
      
      ReproducibleScript:
      
      # s1 is a string with "normal" chars
      
          set s1 gurka
      
          # Give it an internal string rep.
      
          string length $s1
      
          # s1 contains unicode char
      
          set s2 måla
      
          string length $s2
      
          
      
          append s1 $s2
      
          # After the append, the internal string object erroneously is set up
      
          # as a one-byte-per-char string. String index uses this and indexes
      
          # directly, and misses one step.
      
          puts "This: '[string index $s1 8]', should be an 'a'."
      
      
      
      ObservedBehavior:
      
      Append messes up the string object and causes string index to give the
      
          wrong answer.
      
          The bug is in Tcl_AppendObjToObj which does not check uallocated when it
      
          tries
      
          to determine if the appended string is one-byte-per-char.
      
      
      
      Patch:
      
      Index: tclStringObj.c
      
      ===================================================================
      
      RCS file: /cvsroot/tcl/generic/tclStringObj.c,v
      
      retrieving revision 1.12
      
      diff -c -r1.12 tclStringObj.c
      
      *** tclStringObj.c1999/06/16 00:47:561.12
      
      --- tclStringObj.c1999/08/31 18:11:05
      
      ***************
      
      *** 920,926 ****
      
            numChars = stringPtr->numChars;
      
            if ((numChars >= 0) && (appendObjPtr->typePtr == &tclStringType)) {
      
        stringPtr = GET_STRING(appendObjPtr);
      
      ! if (stringPtr->numChars >= 0) {
      
            numChars += stringPtr->numChars;
      
            allOneByteChars = 1;
      
        }
      
      --- 920,926 ----
      
            numChars = stringPtr->numChars;
      
            if ((numChars >= 0) && (appendObjPtr->typePtr == &tclStringType)) {
      
        stringPtr = GET_STRING(appendObjPtr);
      
      ! if (stringPtr->numChars >= 0 && stringPtr->uallocated == 0) {
      
            numChars += stringPtr->numChars;
      
            allOneByteChars = 1;
      
        }
      
      
      
      PatchFiles:
      
      tclStringObj.c
      
      
      
      
      
      Confirmed and fixed for 8.2.1. 
      -- 09/01/1999 hobbs
      
    4. foundin initialized to: "obsolete: 8.2"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "69. Other"
    10. title initialized to: "Bug in append"
    11. type initialized to: "Bug"
  2. Ticket change [1c4eb8806d] (rid 90576) by welch on 2000-10-26 08:31:16:

    1. closedate changed to: "2000-10-26T01:31:16"
    2. closer changed to: "welch"
    3. priority changed to: "2"
    4. resolution changed to: "Fixed"
    5. status changed to: "Closed"
  3. Ticket change [824f65db71] (rid 117215) by dgp on 2001-04-19 03:15:03:

    1. subsystem changed to: "10. Objects"
  4. Ticket change [1d6a75a60f] (rid 90799) by dgp on 2001-04-19 03:15:04:

    1. closedate changed to: "2001-04-18T20:15:04"
    2. closer changed to: "dgp"