summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tclCompile.c4
-rw-r--r--tests/info.test17
2 files changed, 20 insertions, 1 deletions
diff --git a/generic/tclCompile.c b/generic/tclCompile.c
index c0b5dcc..c0203dd 100644
--- a/generic/tclCompile.c
+++ b/generic/tclCompile.c
@@ -3239,8 +3239,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 3057dd2..e0fddb3 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