summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2016-01-12 23:46:18 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2016-01-12 23:46:18 (GMT)
commitb6c01d2ebc11cbe13c4e3656235f1909103dcf53 (patch)
tree307b9b84ca5bba6e5dd7b73ca1c1b40ae8398010
parent13abdb5a3bb7ad56d693defb23426972021f9ea4 (diff)
downloadtcl-b6c01d2ebc11cbe13c4e3656235f1909103dcf53.zip
tcl-b6c01d2ebc11cbe13c4e3656235f1909103dcf53.tar.gz
tcl-b6c01d2ebc11cbe13c4e3656235f1909103dcf53.tar.bz2
fixing the last bug: command compiler returning TCL_ERROR and bailing out
-rw-r--r--generic/tclCompile.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/generic/tclCompile.c b/generic/tclCompile.c
index 0488507..e418f68 100644
--- a/generic/tclCompile.c
+++ b/generic/tclCompile.c
@@ -1553,7 +1553,8 @@ CompileCmdCompileProc(
CompileEnv *envPtr)
{
int depth = TclGetStackDepth(envPtr);
-
+ int savedNumCommands = envPtr->numCommands;
+
if (TCL_OK == TclAttemptCompileProc(interp, parsePtr, 1, cmdPtr, envPtr)) {
TclCheckStackDepth(depth+1, envPtr);
return TCL_OK;
@@ -1564,6 +1565,7 @@ CompileCmdCompileProc(
* partial compiles.
*/
+ envPtr->numCommands = savedNumCommands;
return TCL_ERROR;
}