summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsebres <sebres@users.sourceforge.net>2022-04-26 13:27:16 (GMT)
committersebres <sebres@users.sourceforge.net>2022-04-26 13:27:16 (GMT)
commitaabacf9e13f8a62c916f79cde849149ab05b73c0 (patch)
tree7cc69d16839fb945860c5d1c0f26859eeab8a09c
parentfb6284e74892e0451649cff40291378b663dd448 (diff)
parentba82b0c9afd6e91aa97e13a95cf1a2ee4fcd4097 (diff)
downloadtcl-aabacf9e13f8a62c916f79cde849149ab05b73c0.zip
tcl-aabacf9e13f8a62c916f79cde849149ab05b73c0.tar.gz
tcl-aabacf9e13f8a62c916f79cde849149ab05b73c0.tar.bz2
merge 8.6 (fixes [27520c9b17])
-rw-r--r--generic/tclCompCmdsSZ.c3
-rw-r--r--tests/error.test7
2 files changed, 10 insertions, 0 deletions
diff --git a/generic/tclCompCmdsSZ.c b/generic/tclCompCmdsSZ.c
index aa2d13e..cd3bd37 100644
--- a/generic/tclCompCmdsSZ.c
+++ b/generic/tclCompCmdsSZ.c
@@ -2972,6 +2972,9 @@ TclCompileTryCmd(
goto failedToCompile;
}
finallyToken = TokenAfter(tokenPtr);
+ if (finallyToken->type != TCL_TOKEN_SIMPLE_WORD) {
+ goto failedToCompile;
+ }
} else {
goto failedToCompile;
}
diff --git a/tests/error.test b/tests/error.test
index 064edc7..4ce7709 100644
--- a/tests/error.test
+++ b/tests/error.test
@@ -351,6 +351,13 @@ test error-9.4 {try (ok, non-empty result) with on handler} {
test error-9.5 {try (ok, non-empty result) with on ok handler} {
try { list a b c } on ok {} { list d e f }
} {d e f}
+test error-9.6 {try (compilation of simple finaly token only, bug [27520c9b17])} -body {
+ set b {}; set l {}
+ try {lappend l error} finally [lappend l set b]
+ list $l $b
+} -cleanup {
+ unset -nocomplain b l
+} -result {{set b error} {}}
# simple try tests - "on" handler matching