summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2014-12-04 13:02:43 (GMT)
committerdgp <dgp@users.sourceforge.net>2014-12-04 13:02:43 (GMT)
commit0a2ac311c1e846784b98690d22c678d68ec117ec (patch)
treeab140d81370d606143a478454de52c0eff239e5d
parentf12dc54f7578abc9e2d5f625157263ec5a0bc40e (diff)
parent886a7575564f8e4e164cb67dff4554778650868e (diff)
downloadtcl-0a2ac311c1e846784b98690d22c678d68ec117ec.zip
tcl-0a2ac311c1e846784b98690d22c678d68ec117ec.tar.gz
tcl-0a2ac311c1e846784b98690d22c678d68ec117ec.tar.bz2
merge 8.5
-rw-r--r--generic/tclCompCmds.c2
-rw-r--r--tests/compile.test12
2 files changed, 11 insertions, 3 deletions
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c
index 809a6c6..2f72263 100644
--- a/generic/tclCompCmds.c
+++ b/generic/tclCompCmds.c
@@ -4976,7 +4976,7 @@ PushVarName(
nameChars = p - varTokenPtr[1].start;
elName = p + 1;
remainingChars = (varTokenPtr[2].start - p) - 1;
- elNameChars = (varTokenPtr[n].start - p) + varTokenPtr[n].size - 2;
+ elNameChars = (varTokenPtr[n].start-p) + varTokenPtr[n].size - 1;
if (remainingChars) {
/*
diff --git a/tests/compile.test b/tests/compile.test
index 7e9dcda..7646c12 100644
--- a/tests/compile.test
+++ b/tests/compile.test
@@ -422,14 +422,22 @@ test compile-13.1 {testing underestimate of maxStackSize in list cmd} {exec} {
list [catch {exec [interpreter] << $script} msg] $msg
} {0 OK}
-# Special test for compiling tokens from a copy of the source
-# string [Bug #599788]
+# Tests compile-14.* for [Bug 599788] [Bug 0c043a175a47da8c2342]
test compile-14.1 {testing errors in element name; segfault?} {} {
catch {set a([error])} msg1
catch {set bubba([join $abba $jubba]) $vol} msg2
list $msg1 $msg2
} {{wrong # args: should be "error message ?errorInfo? ?errorCode?"} {can't read "abba": no such variable}}
+test compile-14.2 {testing element name "$"} -body {
+ unset -nocomplain a
+ set a() 1
+ set a(1) 2
+ set a($) 3
+ list [set a()] [set a(1)] [set a($)] [unset a() a(1); lindex [array names a] 0]
+} -cleanup {unset a} -result [list 1 2 3 {$}]
+
+
# Tests compile-15.* cover Tcl Bug 633204
test compile-15.1 {proper TCL_RETURN code from [return]} {
proc p {} {catch return}