Skip to content
Tcl Source Code History Of Ticket e711ffb458
Login

History Of Ticket e711ffb458

Artifacts Associated With Ticket e711ffb458

  1. Ticket change [3a78d39be9] (rid 140767) by dgp on 2014-11-26 20:08:15:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. comment initialized to:
      While looking at [d2ffcca163] there was briefly
      a false lead that the trouble was caused by TclIsLocalScalar().
      That was wrong, but prompted a look at what TILS() was doing
      since it appeared to be doing nothing that made much sense.
      
      All callers of TILS are in tclCompCmds.c -- routines that 
      compile commands into bytecode.  All those routines operate
      on Tcl_Token streams as input.  The parser has already had
      its turn.  Every TILS call is on strings that are already
      marked by the parser as being SIMPLE_WORD.  If they have
      special characters, we already know at this point they've been
      quoted so as to neuter their specialness.
      
      What's wanted where TILS calls are made is a simpler task
      of avoiding arrays and qualified variable names, and the
      right tool for that appears to be PushVarName (still
      confirming that).
      
      Here's a demo of what's (harmlessly) wrong.  First a
      base case for comparison:
      
      % proc demo {} {catch {} {r}; puts '${r}'}
      % tcl::unsupported::disassemble proc demo
      ByteCode 0x0x1779d4b0, refCt 1, epoch 3, interp 0x0x17748250 (epoch 3)
        Source "catch {} {r}; puts '${r}'"
        Cmds 2, src 25, inst 36, litObjs 4, aux 0, stkDepth 4, code/src 0.00
        Proc 0x0x17774b40, refCt 1, args 0, compiled locals 1
            slot 0, scalar, "r"
        Exception ranges 1, depth 1:
            0: level 0, catch, pc 5-12, catch 11
        Commands 2:
            1: pc 0-22, src 0-11         2: pc 23-34, src 14-24
        Command 1: "catch {} {r}"
          (0) beginCatch4 0
          (5) push1 0         # ""
          (7) push1 1         # "0"
          (9) jump1 +4        # pc 13
          (11) pushResult
          (12) pushReturnCode
          (13) endCatch
          (14) reverse 2
          (19) storeScalar1 %v0       # var "r"
          (21) pop
          (22) pop
        Command 2: "puts '${r}'"
          (23) push1 2        # "puts"
          (25) push1 3        # "'"
          (27) loadScalar1 %v0        # var "r"
          (29) push1 3        # "'"
          (31) concat1 3
          (33) invokeStk1 2
          (35) done
      
      
      And now nearly the same case with TILS() taking us down the
      wrong path:
      
      % proc demo {} {catch {} {[}; puts '${[}'}
      % tcl::unsupported::disassemble proc demo
      ByteCode 0x0x1779cbe0, refCt 1, epoch 3, interp 0x0x17748250 (epoch 3)
        Source "catch {} {[}; puts '${[}'"
        Cmds 2, src 25, inst 22, litObjs 5, aux 0, stkDepth 4, code/src 0.00
        Proc 0x0x17772930, refCt 1, args 0, compiled locals 1
            slot 0, scalar, "["
        Commands 2:
            1: pc 0-8, src 0-11          2: pc 9-20, src 14-24
        Command 1: "catch {} {[}"
          (0) push1 0         # "catch"
          (2) push1 1         # ""
          (4) push1 2         # "["
          (6) invokeStk1 3
          (8) pop
        Command 2: "puts '${[}'"
          (9) push1 3         # "puts"
          (11) push1 4        # "'"
          (13) loadScalar1 %v0        # var "["
          (15) push1 4        # "'"
          (17) concat1 3
          (19) invokeStk1 2
          (21) done
      
      Whether the variable name is "r" or "[" makes
      no difference, so we're falling back to command
      invocation for no good reason.  TILS is testing
      the wrong thing for the wrong reason and generating
      less good (though correct) code as a result.
      
    5. foundin initialized to: "all"
    6. is_private initialized to: "0"
    7. login: "dgp"
    8. priority initialized to: "5 Medium"
    9. resolution initialized to: "None"
    10. severity initialized to: "Minor"
    11. status initialized to: "Open"
    12. submitter initialized to: "dgp"
    13. subsystem initialized to: "- New Builtin Commands"
    14. title initialized to: "TclIsLocalScalar() appears wrongheaded"
    15. type initialized to: "Bug"
  2. Ticket change [f818e9a498] (rid 140933) by dkf on 2014-12-12 02:51:52:

    1. icomment:
      Don't forget that the trunk may have additional uses, as the set of compiled things expanded after 8.5. Much of my use of such things as TILS in command compilers is by using existing functioning patterns, rather than analysing what things do in great depth.
      
    2. login: "dkf"
    3. mimetype: "text/html"
    4. username: "dkf"
  3. Ticket change [7fbae43408] (rid 141009) by dgp on 2014-12-19 16:09:28:

    1. icomment:
      
      Corrected in 8.5 branch
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  4. Ticket change [4b9f4028ef] (rid 141028) by dgp on 2014-12-23 02:42:55:

    1. assignee changed to: "dgp"
    2. closedate changed to: "2457014.61314399"
    3. closer changed to: "dgp"
    4. icomment: "and now on trunk too."
    5. login: "dgp"
    6. mimetype: "text/plain"
    7. resolution changed to: "Fixed"
    8. status changed to: "Closed"