Skip to content
Tcl Source Code History Of Ticket 4b61afd660
Login

History Of Ticket 4b61afd660

Artifacts Associated With Ticket 4b61afd660

  1. Ticket change [9a58e1554e] (rid 146918) by beric on 2016-06-10 07:42:10:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. comment initialized to:
      # The following command prints stack with [info frame]
      proc stack {} {
          set level [info frame]
          set result {}
          for {set i 1} {$i < $level} {incr i} {
              lappend result [info frame $i]
          }
          return "[join $result "\n"]"
      }
      
      
      # Test command
      proc info_frame_test {} {
          puts "*** call stack ***"
          puts [stack]
          puts "*** call stack from variable ***"
          set cmd stack
          puts [$cmd]
      }
      
      Now run info_frame_test, the result is:
      
      *** call stack ***
      type eval line 1 cmd info_frame_test level 2
      type proc line 3 cmd stack proc ::info_frame_test level 1
      *** call stack from variable ***
      type eval line 1 cmd info_frame_test level 2
      type proc line -1 cmd {$cmd} proc ::info_frame_test level 1
      
      The line is -1 when stack is called through a variable.
      
    5. foundin initialized to: "8.6.5"
    6. is_private initialized to: "0"
    7. login: "beric"
    8. priority initialized to: "5 Medium"
    9. resolution initialized to: "None"
    10. severity initialized to: "Critical"
    11. status initialized to: "Open"
    12. submitter initialized to: "beric"
    13. subsystem initialized to: "17. Commands I-L"
    14. title initialized to: "[info frame] lost with indirect command call"
    15. type initialized to: "Bug"
  2. Ticket change [915de8fa73] (rid 146924) by dgp on 2016-06-10 13:44:57:

    1. assignee changed to: "aku"
    2. icomment:
      
      See change on branch bug-4b61afd660 to see
      where in the code this choice is made.  That
      branch causes arguably a more sensible value
      to be reported in the demo script submitted,
      but it also causes several tests in the test
      suite to fail, so there are likely tradeoffs
      here I do not appreciate.
      
      Passing on to the TIP 280 man...
      
    3. login: "dgp"
    4. mimetype: "text/plain"
  3. Ticket change [e6a4760063] (rid 146925) by beric on 2016-06-10 14:47:49:

    1. icomment:
      Thanks for pointing out where is the problem.
      I tried to mitigate your patch (in 8.6.5) with the following:
      
      	wwlines[wordIdx] =
      		(wordIdx == 0 || TclWordKnownAtCompileTime(tokenPtr, NULL) ? wordLine : -1);
      
      In fact, my case only involves the first word.
      
      Guess what, no more info test failure, and the reported line is ok :-)
      
      Now, if someone can explain...
      
    2. login: "beric"
    3. mimetype: "text/plain"
  4. Ticket change [93c496f32c] (rid 146927) by aku on 2016-06-11 18:19:21:

    1. assignee changed to: "dgp"
    2. icomment:
      Ok. Let me see if I can shed some light on things.
      The function in question is *EnterCmdWordData*
      It is used during the byte compilation of code to record the lines each word of a single command starts at.
      This is part of the code propagating line information around for others to use.
      
      For example, when a command like
      
          while <expression> <script>
      
      is compiled we have to know the line <script> starts on so that when we compile that part as well we know from there to start counting for the commands inside of <script>.
      
      However when the command is
      
          while <expression> $script
      
      then counting from the beginning of where '$script' was found does not make sense and would provide the user with completely bogus line information somewhere into the script the 'while' is a part of. So the "-1" is stuck into that slot to signal to the using place that there is no valid line to start from. And I now wish that I had used a named constant for that marker so that I could quickly find and point you to these using places in the core.
      
      Regardless, that is why the unconditional use of the line information makes tests fail. These should be the tests that check that the type of propagation I mentioned is properly broken. ... Yes, the first fail is info-23.5, a direct example of this.
      
      That is also why beric's alternate fix (adding the 'wordIdx == 0' clause) does work.
      
      The word[0] of a command is always the command's _name_. It cannot be a script. (*1*)
      
      So for this one word of the whole command we can get away with not setting the marker value even if that word is not known at compile time, i.e. $cmd, [cmd], etc.
      
      I will not object to accepting that change, although I would recommend to record the reason for why it works outside of the code, with reference to the relevant section of Tcl.n underlying the reasoning, i.e. (*1*). So that if this thing evre changes we know what places to be wary of and in need of an update.
      
    3. login: "aku"
    4. mimetype: "text/plain"
  5. Ticket change [3b57be0ead] (rid 146947) by beric on 2016-06-15 06:58:14:

    1. icomment: "Thanks for the explanation aku."
    2. login: "beric"
    3. mimetype: "text/plain"
  6. Ticket change [9c068f8ab8] (rid 146992) by dgp on 2016-06-16 17:16:23:

    1. closedate changed to: "2457556.21971646"
    2. closer changed to: "dgp"
    3. login: "dgp"
    4. mimetype: "text/plain"
    5. resolution changed to: "Fixed"
    6. status changed to: "Closed"
    7. subsystem changed to: "47. Bytecode Compiler"