summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2013-09-19 15:04:47 (GMT)
committerdgp <dgp@users.sourceforge.net>2013-09-19 15:04:47 (GMT)
commit68feed9f4e09c3677ca335a790e197df2bdc5cf5 (patch)
tree50d9dfaabeaa6ad00cbc0faa2aa15af6c593c48e
parent58c74e141ff1c65580defe7237e86826b15afea2 (diff)
downloadtcl-68feed9f4e09c3677ca335a790e197df2bdc5cf5.zip
tcl-68feed9f4e09c3677ca335a790e197df2bdc5cf5.tar.gz
tcl-68feed9f4e09c3677ca335a790e197df2bdc5cf5.tar.bz2
Line numbers wrong in compiled [dict update].
-rw-r--r--generic/tclCompCmds.c2
-rw-r--r--tests/dict.test6
2 files changed, 7 insertions, 1 deletions
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c
index 348910c..51a566e 100644
--- a/generic/tclCompCmds.c
+++ b/generic/tclCompCmds.c
@@ -1159,7 +1159,7 @@ TclCompileDictUpdateCmd(
infoIndex = TclCreateAuxData(duiPtr, &tclDictUpdateInfoType, envPtr);
for (i=0 ; i<numVars ; i++) {
- CompileWord(envPtr, keyTokenPtrs[i], interp, i);
+ CompileWord(envPtr, keyTokenPtrs[i], interp, 2*i+2);
}
TclEmitInstInt4( INST_LIST, numVars, envPtr);
TclEmitInstInt4( INST_DICT_UPDATE_START, dictIndex, envPtr);
diff --git a/tests/dict.test b/tests/dict.test
index bd7b920..7b584e8 100644
--- a/tests/dict.test
+++ b/tests/dict.test
@@ -1271,6 +1271,12 @@ test dict-23.7 {CompileWord OBOE} {
} {}
}} [linenumber]
} 2
+test dict-23.8 {CompileWord OBOE} {
+ apply {n {
+ dict update foo {*}{
+ } [return [incr n -[linenumber]]] x {}
+ }} [linenumber]
+} 1
rename linenumber {}