Overview
| Artifact ID: | 93c496f32c222e86cbeb7beda625d785ae628149 |
|---|---|
| Ticket: | 4b61afd660d7a1d29ecf794426f46a7384b4a41f
[info frame] lost with indirect command call |
| User & Date: | aku on 2016-06-11 18:19:21 |
Changes
- assignee changed to: "dgp"
- 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. - login: "aku"
- mimetype: "text/plain"