interp command
Closed / Fixed219192ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 05:03:20
OriginalBugID: 2606 Bug
Version: 8.1
SubmitDate: '1999-08-31'
LastModified: '1999-12-03'
Severity: MED
Status: Assigned
Submitter: techsupp
ChangedBy: hobbs
OS: Linux
Machine: Other
FixedDate: '2000-10-25'
ClosedDate: '2000-10-25'
Name:
Andreas Otto
Extensions:
tclx
ReproducibleScript:
interp create X1
interp hide X1 set
interp invokehidden X1 set b(123)
==> can't read "b": no such variable
should be
==> can't read "b(123)": no such variable
DesiredBehavior:
get the right answer
dkfplain2000-11-08 22:57:37
Still there in 8.3.2, and probably 8.4a2 too (if the source and my understanding of the problem are anything to go by. :^) To fix, change all the places that refer to the variable part2 in the function TclLookupVar() (well, those after line 187 of generic/tclVar.c, which is where the namespace variable resolver stuff starts) to refer to the local variable elName instead. I make this eight modifications, each time in a call to VarErrMsg(). I believe this problem was introduced with the dropping of the TCL_PARSE_PART1 flag; the ChangeLog should reveal when that happened... I will apply a fix as and when I've got access to the sources sorted out. To remind myself, I've assigned the bug to me...
dkf Closed ticket [219192ffff].
[History diff]2000-11-15 21:09:20
dgpplain2000-11-16 00:24:35
The change causes a whole slew of test suite errors
starting with
==== append-3.2 append errors FAILED
==== Contents of test case:
set x ""
list [catch {append x(0) 44} msg] $msg
---- Result was:
1 {can't set "x(0)(0))": variable isn't array}
---- Result should have been (exact matching):
1 {can't set "x(0)": variable isn't array}
==== append-3.2 FAILED
hobbsplain2000-11-16 05:13:32
The dkf fix broke numerous other tests and has been reverted. This bug is still open.
dkfplain2000-11-17 16:37:08
The bug can be reproduced using the following simpler code:
[format set] nonexistent(variable)
Am investigating why this should induce problems in the rest of Tcl. Something's rotten in the state of Denmark...
dkfplain2000-11-17 20:37:55
Right, I'm closing this again now since not only is there a test that detects the problem, the fix now applied does the right thing (the code is a bit cleaner too) and passes all the tests. Interestingly, there was actually a test that was mandating the old, wrong behaviour, so the patch required a change to that test too.
Log in (anonymous is fine) to add a comment.