Overview
| Artifact ID: | 15a3530d9a0cf6f7a024e7223abbcbaf18806156 |
|---|---|
| Ticket: | 1a25fdfec6ecf9064dcd6337d00db87028a96188
IndexTailVarIfKnown makes pointless call |
| User & Date: | dgp on 2016-03-11 14:25:13 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/plain"
- 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. - foundin changed to: "all"
- is_private changed to: "0"
- login: "dgp"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- severity changed to: "Minor"
- status changed to: "Open"
- submitter changed to: "dgp"
- subsystem changed to: "47. Bytecode Compiler"
- title changed to: "IndexTailVarIfKnown makes pointless call"
- type changed to: "Bug"