Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 1e20552e8edd117c3eda20beb1cfa68de9c3fd38
Ticket: 2969488fffffffffffffffffffffffffffffffff
trace variable doesn't fire if you upvar to an array element
User & Date: ferrieux on 2010-03-13 00:22:21
Changes

  1. icomment:
    Hmm, I think it's not as unsolvable as it seems.
    The test TclIsVarDirectWritable(varPtr) is currently:
    
        !((varPtr)->flags & (VAR_ARRAY|VAR_LINK|VAR_TRACED_WRITE|VAR_DEAD_HASH))
    
    and in this case it returns 'true' because the linked array element's flags are only
    
       VAR_ARRAY_ELEMENT | VAR_IN_HASHTABLE
    
    Now, I believe we can still reach the containing array with moderate additional complexity , because the  VAR_IN_HASHTABLE shows that the (Var *) is in fact a (VarInHash *), whose entry->tablePtr is the array's backing hashtable. Dunno exactly how easily we could climb back from hashtable to array, but we could even add a field in the hashtable struct for that. The important thing is that we don't need a per-element field.
    
    Miguel, do you agree with this view ? 
    
    
  2. login: "ferrieux"
  3. mimetype: "text/plain"
  4. username: "ferrieux"