Artifacts Associated With Ticket 835020ffffffffffffffffffffffffffffffffff
Ticket change [6160801c86] (rid 92232) by pbiereic on 2003-11-03 13:29:51:
- assignee initialized to: "msofer"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Tcl version: 8.4.3 OS platform: Redhat 9, Solaris 2.8, SuSE 8, HP-UX 11 Problem behaviour: "lassign" does not store the value of the member variable x in method "store" (see sample code). Running the sample code will print "0" on 8.4.3 and "2" on previous versions. If the member variable x is referenced (e.g. with "set a $x" then 8.4.3 will print the correct value. Expected Behavior: as for previous tcl (tclx) versions Concise Code Sample: package require Tclx package require Itcl itcl::class T { protected variable x 0 constructor {args} { store print } protected method store {} { lassign 2 x # set a $x } protected method print {} { puts $x } } T t - foundin initialized to: "obsolete: 8.4.3"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "pbiereic"
- subsystem initialized to: "07. Variables"
- title initialized to: "lassign to member variables in itcl methods"
- type initialized to: "Bug"
Ticket change [d754f41683] (rid 123964) by msofer on 2003-11-04 00:16:53:
- icomment:
Logged In: YES user_id=148712 It looks like it could be a symptom of bug https://sourceforge.net/tracker/index.php?func=detail&aid=631741&group_id=10894&atid=110894 which is fixed in Tcl8.4.4 Does upgrading solve the issue?
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [3e5c6d0e7a] (rid 121250) by pbiereic on 2003-11-04 02:25:53:
- icomment:
Logged In: YES user_id=422762 Using Tcl 8.4.4 did not solve the issue.
- login: "pbiereic"
- mimetype: "text/plain"
- username: "pbiereic"
- icomment:
Ticket change [650f06ec24] (rid 92879) by msofer on 2003-11-04 05:11:12:
- icomment:
Logged In: YES user_id=148712 TclX's lassign does a lookup by name, as Tcl_SetVar2Ex(interp, Tcl_GetStringFromObj(objv [idx], NULL), NULL, elemPtr, TCL_PARSE_PART1 | TCL_LEAVE_ERR_MSG) Apparently the problem is in how itcl varname resolver interact with the new tclVar code in this particular case; more research needed ...
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [dff435e759] (rid 115109) by eallaert on 2003-11-14 15:03:30:
- icomment:
Logged In: YES user_id=204408 This problem appears also for TclX's "keylset" command, its "loop" command and any other command that is using a var-name as an argument. So the problem has unfortunately a much wider scope than originally reported.
- login: "eallaert"
- mimetype: "text/plain"
- username: "eallaert"
- icomment:
Ticket change [ad33c23bc2] (rid 101432) by msofer on 2003-11-20 23:50:09:
- foundin changed to: "obsolete: 8.4.4"
Ticket change [dd0564b5ea] (rid 114587) by msofer on 2003-11-20 23:50:10:
- icomment:
Logged In: YES user_id=148712 Eril Allaert reports in clt (verified with 8.4.4): Try the following script, using tclsh: package require Itcl package require Tclx itcl::class Test { variable x 0 variable y 0 constructor {args} { prep; # this should modify x and y ... puts "$x [incr y]"; # ... which should be noticeable here } method prep {} { loop x 1 3 {puts "$x [incr y]"} puts "local vars: >[info locals]<" } } Test t Expected output: 4 lines containing resp "1 1", "2 2", "local vars: ><" and "3 3". You get exactly that with Tcl 8.3.4, [incr Tcl] 3.2 and TclX 8.3.5. But with Tcl 8.4.3, iTcl 3.3 and TclX 8.4 the last line is "0 3", and the one before "local vars: >x<". Same if Tcl is upgraded to Tcl 8.4.4. Replacing TclX's loop command in the method prep by any of the 17 other TclX commands that require a variable name as argument demonstrates the same problem. The work-around to get this working again as expected is to have at least one standard Tcl command referring to this variable (e.g. "set x") anywhere within this prep method. This was reported as bug 835020 on SF, but initially mentioned only TclX's "lassign" command. - login: "msofer"
- mimetype: "text/plain"
- priority changed to: "8"
- username: "msofer"
- icomment:
Ticket change [bc8e095b78] (rid 101770) by dkf on 2003-11-21 01:09:44:
- icomment:
Logged In: YES user_id=79902 Miguel's tracked this down to a clash between LOOKUP_FOR_UPVAR and TCL_PARSE_PART1
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [3c70f3fcf4] (rid 120919) by msofer on 2003-11-21 01:50:37:
- icomment:
Logged In: YES user_id=148712 Bug found, fix committed to HEAD (8.5a0). It is possibly too late to get this fixed in 8.4.5, already frozen ... If you are compiling tcl from source: the fix is changing in generic/tclVar.c the flag value LOOKUP_FOR_UPVAR to 0x40000 (to avoid a collision with the deprecated TCL_PARSE_PART1, used throughout TclX).
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [5078ee01a0] (rid 125976) by msofer on 2003-11-21 01:52:07:
- icomment:
Logged In: YES user_id=148712 Leaving open until tests for this bug are added to the testsuite
- login: "msofer"
- mimetype: "text/plain"
- priority changed to: "4"
- username: "msofer"
- icomment:
Ticket change [9b23b950b3] (rid 111070) by eallaert on 2003-11-21 19:32:02:
- icomment:
Logged In: YES user_id=204408 I've tried the fix given by Miguel (changing LOOKUP_FOR_UPVAR in the file tclVar.c) on Tcl 8.4.3 and Tcl 8.4.4. I confirm that it fixes the problem as reported.
- login: "eallaert"
- mimetype: "text/plain"
- username: "eallaert"
- icomment:
Ticket change [10b33bd8c7] (rid 95005) by msofer on 2004-03-27 04:57:02:
- closedate changed to: "2004-03-26T21:57:02"
- closer changed to: "msofer"
- icomment:
Logged In: YES user_id=148712 No pure-tcl test possible, I'm afraid. If anybody's got an idea ...
- login: "msofer"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Pending"
- username: "msofer"
Ticket change [ed22514d68] (rid 103825) by dkf on 2004-03-29 16:16:41:
- icomment:
Logged In: YES user_id=79902 Exercising the API with the fault should be done via the tcltest binary even though the actual fault requires Itcl as well. 8.5 won't hit this with lassign, since that command has been completely reimplemented there.
- login: "dkf"
- mimetype: "text/plain"
- status changed to: "Open"
- username: "dkf"
- icomment:
Ticket change [7836572648] (rid 89917) by msofer on 2004-03-30 09:39:16:
- closedate changed to: "2004-03-30T02:39:16"
- closer changed to: "msofer"
- icomment:
Logged In: YES user_id=148712 Change of opinion: I do not think that a test for this particular flag collision's symptoms is necessary or interesting. Closing.
- login: "msofer"
- mimetype: "text/plain"
- status changed to: "Closed"
- username: "msofer"