Skip to content
Tcl Source Code History Of Ticket 218873
Login

History Of Ticket 218873

Artifacts Associated With Ticket 218873

  1. Ticket change [0dffcb3887] (rid 94531) by nobody on 2000-10-26 01:07:01:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      OriginalBugID: 2496 Bug
      Version: 8.2b1
      SubmitDate: '1999-08-04'
      LastModified: '1999-08-04'
      Severity: LOW
      Status: Released
      Submitter: techsupp
      ChangedBy: hobbs
      OS: Other
      Machine: NA
      FixedDate: '1999-08-04'
      FixedInVersion: 8.2
      ClosedDate: '2000-10-25'
      
      
      Name:
      Peter Spjuth
      
      ObservedBehavior:
      In tclLiteral.c, line 271, in the function TclRegisterLiteral,
          the following can be found:
          
          if (TclLooksLikeInt(bytes, length)) {
              if (TclGetLong((Tcl_Interp *) NULL, bytes, &n) == TCL_OK) {
          TclFormatInt(buf, n);
          if (strcmp(bytes, buf) == 0) {
              objPtr->internalRep.longValue = n;
              objPtr->typePtr = &tclIntType;
          }
              }
          }
          
          This is supposed to detect integer literals and give them an
          integer internal representation from the start.
          In reality though, it don't seem to work.
          
          What I believe is a bug is using "bytes" in the calls to
          TclGetLong and strcmp, since the literal at "bytes" is not null
          terminated. Typically, "bytes" is within a string being parsed,
          making it important to always use "length".
          On the code lines above these, the literal string is copied to
          "objPtr" and, as far as I can see, the resulting string in
          "objPtr" becomes properly null terminated.
          Thus, using "objPtr->bytes" instead of "bytes" in those two calls
          feels like a better solution.
          
          I haven't found any way to detect this bug using standard Tcl.
          I have a thing called "info internalrep" which gives the
          internal representation for an object. I found it odd that
          "info internalrep 4" returned "int" and "info internalrep 5"
          did not, and that put me on the track for this bug.
          
          I have not made any patch for this, since I currently can't test it.
      
      
      
      This change has been made for 8.2b3 (GetLong and strcmp calls
      use the objPtr->bytes). 
      -- 08/04/1999 hobbs
      
    4. foundin initialized to: "obsolete: 8.2b1"
    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 TclRegisterLiteral()"
    11. type initialized to: "Bug"
  2. Ticket change [0f0f90c72c] (rid 94726) by welch on 2000-10-26 08:30:15:

    1. closedate changed to: "2000-10-26T01:30:15"
    2. closer changed to: "welch"
    3. priority changed to: "2"
    4. resolution changed to: "Fixed"
    5. status changed to: "Closed"
  3. Ticket change [c7cdbf9665] (rid 122004) by dgp on 2001-04-18 22:29:00:

    1. closedate changed to: "2001-04-18T15:29:00"
    2. closer changed to: "dgp"
    3. subsystem changed to: "47. Bytecode Compiler"