Tcl Source Code

View Ticket
Login
Ticket UUID: 1833522
Title: Compiled [info exists] does not trigger array read traces
Type: Bug Version: obsolete: 8.5b2
Submitter: das Created on: 2007-11-17 04:14:38
Subsystem: 47. Bytecode Compiler Assigned To: dkf
Priority: 9 Immediate Severity:
Status: Closed Last Modified: 2007-11-17 22:11:40
Resolution: Fixed Closed By: das
    Closed on: 2007-11-17 15:11:40
Description:
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)]"
User Comments: das added on 2007-11-17 22:11:40:

File Deleted - 254704: 



File Added - 254729: 1833522.diff

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

das added on 2007-11-17 16:11:43:

File Deleted - 254700: 



File Added - 254704: 1833522.diff

Logged In: YES 
user_id=90580
Originator: YES

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

das added on 2007-11-17 15:13:29:

File Added - 254700: 1833522.diff

Logged In: YES 
user_id=90580
Originator: YES

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

Attachments: