Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 15a3530d9a0cf6f7a024e7223abbcbaf18806156
Ticket: 1a25fdfec6ecf9064dcd6337d00db87028a96188
IndexTailVarIfKnown makes pointless call
User & Date: dgp on 2016-03-11 14:25:13
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/plain"
  4. comment changed to:
    In tclCompCmdsGR.c the routine IndexTailVarIfKnown()
    misuses TclWordKnownAtCompileTime().
    
    The overall routine is examining the word 
    parsed in varTokenPtr, and wants to report whether
    the tail portion of that word can be determined
    so the local varname can be known, and bytecode
    can be generated for commands like [global] and [variable].
    
    In particular it appears to want to support bytecoding
    of things like
    
        variable [find-namesapce]::foo
    
    where the whole value of the argument is not known
    until runtime, but we know the tail portion now, so
    we know the local name argument to INST_NSUPVAR.
    
    The problem is the routine TclWordKnownAtCompileTime()
    is called to ask whether the final portion of the
    argument word (the 'last token') is known.  This use
    misses the fact that TWKACT is explicitly the routine
    Tcl***WORD***KnownAtCompileTime() and will only return
    true for an entire word, not for tail portions of a word.
    This call always returns false as written.  All the code
    written to handle a true return is unused and worthless.
    
    The idea here seems worthwhile, so the fix may be to just
    put the needed testing here directly, replacing the misused
    TWKACT call.
    
  5. foundin changed to: "all"
  6. is_private changed to: "0"
  7. login: "dgp"
  8. priority changed to: "5 Medium"
  9. resolution changed to: "None"
  10. severity changed to: "Minor"
  11. status changed to: "Open"
  12. submitter changed to: "dgp"
  13. subsystem changed to: "47. Bytecode Compiler"
  14. title changed to: "IndexTailVarIfKnown makes pointless call"
  15. type changed to: "Bug"