Artifacts Associated With Ticket 218965ffffffffff
Ticket change [231af8abd6] (rid 130861) by nobody on 2000-10-26 01:08:41:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
OriginalBugID: 3339 Bug Version: 8.2.1 SubmitDate: '1999-11-05' LastModified: '1999-12-09' Severity: MED Status: Released Submitter: techsupp ChangedBy: hobbs RelatedBugIDs: 2551 OS: Linux-Red Hat FixedDate: '1999-12-09' FixedInVersion: 8.3b1 ClosedDate: '2000-10-25' Name: Jean-Luc Fontaine Comments: bug also present in 8.0 and 8.1 releases ReproducibleScript: namespace eval n { proc p {} { variable {} set (0) 0 set (1) 1 set n 2 set ($n) 2 set ($n,foo) 2 } p parray {} } ObservedBehavior: ouput: (0) = 0 (2,foo) = 2 DesiredBehavior: output: (0) = 0 (1) = 1 (2) = 2 (2,foo) = 2 More info from Jean-Luc: I found what happened in tclCompile.c, TclFindCompiledLocal(): ... for (i = 0; i < localCt; i++) { if (!TclIsVarTemporary(localPtr)) { char *localName = localPtr->name; if ((name[0] == localName[0]) && (nameBytes == localPtr->nameLength) && (strncmp(name, localName, (unsigned) nameBytes) == 0)) { return i; } } localPtr = localPtr->nextPtr; } ... For the following Tcl source code: namespace eval n {proc p {} {variable {}; set (a) 0; set (b) 1}} if we look at what happens at the following line: if ((name[0] == localName[0]) For (a), name is "(a) 0; set (b) 1" and we never get there, which is normal since the {} array is not yet allocated. For (b), name is "(b) 1" and since localName is "" (empty name array allocated at the (a) occurence), comparing the first characters ('(' and '\0') is wrong. The fix consists in removing the test on the first byte. ----- This is correct, that slight opt breaks the {} array name case, and is covered by the strncmp. -- 12/09/1999 hobbs - foundin initialized to: "obsolete: 8.2.1"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "07. Variables"
- title initialized to:
empty name array setting failure within namespace procedure
- type initialized to: "Bug"
Ticket change [863539647a] (rid 131461) by welch on 2000-10-26 08:32:16:
- closedate changed to: "2000-10-26T01:32:16"
- closer changed to: "welch"
- priority changed to: "2"
- resolution changed to: "Fixed"
- status changed to: "Closed"