diff options
| author | dgp <dgp@users.sourceforge.net> | 2016-06-16 16:59:09 (GMT) |
|---|---|---|
| committer | dgp <dgp@users.sourceforge.net> | 2016-06-16 16:59:09 (GMT) |
| commit | d418226edb26ced6ce6d46dffe7364795280f48e (patch) | |
| tree | d7b91cce5052518604586c81a15019913ed3e301 | |
| parent | bdfafd3539b5d5762bca9907ad9e6bb4f0e347cf (diff) | |
| download | tcl-d418226edb26ced6ce6d46dffe7364795280f48e.zip tcl-d418226edb26ced6ce6d46dffe7364795280f48e.tar.gz tcl-d418226edb26ced6ce6d46dffe7364795280f48e.tar.bz2 | |
Improve fix and add test.
| -rw-r--r-- | generic/tclCompile.c | 7 | ||||
| -rw-r--r-- | tests/info.test | 17 |
2 files changed, 19 insertions, 5 deletions
diff --git a/generic/tclCompile.c b/generic/tclCompile.c index 8cdd9d2..31e69ad 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -2602,12 +2602,9 @@ EnterCmdWordData( TclAdvanceLines (&wordLine, last, tokenPtr->start); TclAdvanceContinuations (&wordLine, &wordNext, tokenPtr->start - envPtr->source); -#if 0 wwlines[wordIdx] = - (TclWordKnownAtCompileTime(tokenPtr, NULL) ? wordLine : -1); -#else - wwlines[wordIdx] = wordLine; -#endif + ((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 937da8c..d30bf9a 100644 --- a/tests/info.test +++ b/tests/info.test @@ -1818,6 +1818,23 @@ test info-38.2 {location information for uplevel, dl, direct-literal} -match glo * {type source line 1814 file info.test cmd etrace level 1} * {type source line 1812 file info.test cmd uplevel\\ \\\\ level 1}} -cleanup {interp delete sub} +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 |
