SourceForge has been redesigned. Learn more.
Close

#1226 interp command

obsolete: 8.3.2
closed-fixed
4
2000-11-17
2000-10-26
Anonymous
No

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

Discussion

  • Donal K. Fellows

    • milestone: 102424 --> obsolete: 8.3.2
    • assigned_to: nobody --> dkf
    • priority: 5 --> 4
     
  • Donal K. Fellows

    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...

     
  • Donal K. Fellows

    • status: open --> closed-fixed
     
  • Don Porter

    Don Porter - 2000-11-15

    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

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2000-11-15

    The dkf fix broke numerous other tests and has been reverted. This bug is still open.

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2000-11-15
    • assigned_to: dkf --> nobody
    • status: closed-fixed --> open
     
  • Donal K. Fellows

    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...

     
  • Donal K. Fellows

    • assigned_to: nobody --> dkf
    • status: open --> closed-fixed
     
  • Donal K. Fellows

    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.