Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: d0eb7b4919b10a7206c3f27ecaf557453d498e79
Ticket: 736729ffffffffffffffffffffffffffffffffff
variable name resolution broken
User & Date: msofer on 2004-05-22 16:36:13
Changes

  1. icomment:
    Logged In: YES 
    user_id=148712
    
    Thebug is not in the obj type, but rather in the lookup
    mechanism. The bug is still present in HEAD with the
    temporary fix; a script that exposes it is
      % namespace eval a upvar x q
      % namespace eval b set x 0
      0
      % set x
      0
    
    What is happening in the original script is:
      - x is a shared literal (created by init.tcl)
      - 'set x 1; unset x' shimmers x to tclNsVarNameType
      - the shared literal keeps an (undefined) variable x in
    the global hashtable
      - the lookup mechanism finds the variable in the
    hashtable, and uses it
    In this new version, x is kept in the hashtable by upvar
    instead.
    
    
  2. login: "msofer"
  3. mimetype: "text/plain"
  4. username: "msofer"