diff options
author | dgp <dgp@users.sourceforge.net> | 2016-06-16 17:15:28 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2016-06-16 17:15:28 (GMT) |
commit | b300fecc273eaba2438bba8e4719e2f553b73344 (patch) | |
tree | b2f1719bec6d4529e978a19c4f3f74201d60b816 | |
parent | 7b7647f1ab5baf2def231c07f87d12b656528696 (diff) | |
parent | 482ab2e9dc9a2db3f9ee113e2b871359bbd2d09e (diff) | |
download | tcl-b300fecc273eaba2438bba8e4719e2f553b73344.zip tcl-b300fecc273eaba2438bba8e4719e2f553b73344.tar.gz tcl-b300fecc273eaba2438bba8e4719e2f553b73344.tar.bz2 |
[4b61afd660] Allow [info frame] to record line info for substituted command names.
-rw-r--r-- | generic/tclCompile.c | 4 | ||||
-rw-r--r-- | tests/info.test | 17 |
2 files changed, 20 insertions, 1 deletions
diff --git a/generic/tclCompile.c b/generic/tclCompile.c index 2042bcc..b1b67a8 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -3276,8 +3276,10 @@ EnterCmdWordData( TclAdvanceLines(&wordLine, last, tokenPtr->start); TclAdvanceContinuations(&wordLine, &wordNext, tokenPtr->start - envPtr->source); + /* See Ticket 4b61afd660 */ wwlines[wordIdx] = - (TclWordKnownAtCompileTime(tokenPtr, NULL) ? wordLine : -1); + ((wordIdx == 0) || TclWordKnownAtCompileTime(tokenPtr, NULL)) + ? wordLine : -1; ePtr->line[wordIdx] = wordLine; ePtr->next[wordIdx] = wordNext; last = tokenPtr->start; diff --git a/tests/info.test b/tests/info.test index 60b9e66..a6a5919 100644 --- a/tests/info.test +++ b/tests/info.test @@ -2398,6 +2398,23 @@ test info-33.35 {{*}, literal, simple, bytecompiled} -body { # ------------------------------------------------------------------------- unset -nocomplain res +test info-39.0 {Bug 4b61afd660} -setup { + proc probe {} { + return [dict get [info frame -1] line] + } + set body { + set cmd probe + $cmd + } + proc demo {} $body +} -body { + demo +} -cleanup { + unset -nocomplain body + rename demo {} + rename probe {} +} -result 3 + # cleanup catch {namespace delete test_ns_info1 test_ns_info2} ::tcltest::cleanupTests |