#3844 Compiled [info exists] does not trigger array read traces

obsolete: 8.5b2
closed-fixed
9
2007-11-17
2007-11-17
No

The new compiled [info exists] does not trigger read traces on arrays.
In particular, this breaks constraint testing in tcltest via the SafeFetch read trace on the testConstraints array...

array set a {}
trace variable a r {apply {{a k o} {puts stderr "readtrace $a $k $o"}}}
if {1} { puts stderr "compiled: [info exists a(x)]" }
puts stderr "uncompiled: [info exists a(x)]"

Discussion

  • Daniel A. Steffen

    Logged In: YES
    user_id=90580
    Originator: YES

    the attached patch fixes the problem (following TclVarTraceExists() implementation)
    File Added: 1833522.diff

     
  • Daniel A. Steffen

    Logged In: YES
    user_id=90580
    Originator: YES

    revised patch attached, missed one case earlier
    File Added: 1833522.diff

     
  • Daniel A. Steffen

    Logged In: YES
    user_id=90580
    Originator: YES

    read trace handling for INST_EXIST_SCALAR was also incorrect, revised patch attached. Also replaces var value.objPtr NULL checks by TclIsVarUndefined() macro.

    With this, Tcl and Tk testsuites pass again with no bogus constraint skipping, so committing to HEAD.

    File Added: 1833522.diff

     
  • Daniel A. Steffen

    patch to tclExecute.c r1.350

     
  • Daniel A. Steffen

    • status: open --> closed-fixed