Artifacts Associated With Ticket 218873
Ticket change [0dffcb3887] (rid 94531) by nobody on 2000-10-26 01:07:01:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- 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 - foundin initialized to: "obsolete: 8.2b1"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "69. Other"
- title initialized to: "Bug in TclRegisterLiteral()"
- type initialized to: "Bug"
Ticket change [0f0f90c72c] (rid 94726) by welch on 2000-10-26 08:30:15:
- closedate changed to: "2000-10-26T01:30:15"
- closer changed to: "welch"
- priority changed to: "2"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [c7cdbf9665] (rid 122004) by dgp on 2001-04-18 22:29:00:
- closedate changed to: "2001-04-18T15:29:00"
- closer changed to: "dgp"
- subsystem changed to: "47. Bytecode Compiler"