Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: a2d7d8786285718d898a703711f1131df0958569
Ticket: 1998273fffffffffffffffffffffffffffffffff
Making a proc arg's unshared
User & Date: msofer on 2008-06-20 05:59:01
Changes

  1. icomment:
    
    
    data_type - 360894
    
    Logged In: YES 
    user_id=148712
    Originator: NO
    
    (a) even better than '$x[unset x]' is '$x[set x {}]', as it is completely bytecompiled (unset is not)
    
    (b) I think this belongs in the FR tracker, not patches. It may even require a TIP? The implicit contract is that the caller keeps the objv valid until the callee returns, and the CallFrame keeps a copy. This patch violates the contract.
    
    I still want to explore the full consequences of this, but is is definitely NOT 100% harmless:
      * Stack traces cease to work properly
      * Debuggers may suffer the loss of [info level], especially if they rely on leave traces. 
      * [unknown] needs a proper [info level], and there are probable more such beasts. Not sure that this breaks it, as long as [unknown] doesn't call [info zaplevel] itself
      * Scripts like the following, and other commands that inspect the CallFrame stack, also stop working:
    
    proc foo x {
        info zaplevel
        ...
        moo
    }
    
    proc moo args {
        if {![llength $args]} {
            set args [info level -1]
        }
        boo $args
    }
    
    ...
        
    
    
  2. login: "msofer"
  3. mimetype: "text/plain"
  4. subsystem changed to: "10. Objects"
  5. username: "msofer"