summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2014-08-01 16:01:30 (GMT)
committerdgp <dgp@users.sourceforge.net>2014-08-01 16:01:30 (GMT)
commitd6128e2e73aa4d49417ff9beddd89216f0df77db (patch)
treebc9eb2b5d0d9c1044b0b74dad63a33ad9613e15b /generic
parent374022fc5dab400eaec3c8af83d78f75e53a488f (diff)
downloadtcl-d6128e2e73aa4d49417ff9beddd89216f0df77db.zip
tcl-d6128e2e73aa4d49417ff9beddd89216f0df77db.tar.gz
tcl-d6128e2e73aa4d49417ff9beddd89216f0df77db.tar.bz2
[e75fabac06] Teardown line information after failed ensemble subcommand
compile attempts. Copy/paste from CompileCmdCompileProc(). May be refactor opportunity here.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclEnsemble.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c
index 763f5a0..473c4bb 100644
--- a/generic/tclEnsemble.c
+++ b/generic/tclEnsemble.c
@@ -2749,6 +2749,7 @@ TclCompileEnsemble(
int ourResult = TCL_ERROR;
unsigned numBytes;
const char *word;
+ DefineLineInformation;
Tcl_IncrRefCount(replaced);
if (parsePtr->numWords < depth + 1) {
@@ -3008,6 +3009,23 @@ TclCompileEnsemble(
}
/*
+ * Throw out any line information generated by the failed compile attempt.
+ */
+
+ while (mapPtr->nuloc - 1 > eclIndex) {
+ mapPtr->nuloc--;
+ ckfree(mapPtr->loc[mapPtr->nuloc].line);
+ mapPtr->loc[mapPtr->nuloc].line = NULL;
+ }
+
+ /*
+ * Reset the index of next command. Toss out any from failed nested
+ * partial compiles.
+ */
+
+ envPtr->numCommands = mapPtr->nuloc;
+
+ /*
* Failed to do a full compile for some reason. Try to do a direct invoke
* instead of going through the ensemble lookup process again.
*/