summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2003-03-19 22:52:48 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2003-03-19 22:52:48 (GMT)
commit314d846ee13a650c95f79ad7295527e186f063c2 (patch)
tree5c9d0de7b80f32567b198a8628a7cf5f16dbb901 /generic
parent23e1c85533891dd272a2c1f067e83af2342c1c52 (diff)
downloadtcl-314d846ee13a650c95f79ad7295527e186f063c2.zip
tcl-314d846ee13a650c95f79ad7295527e186f063c2.tar.gz
tcl-314d846ee13a650c95f79ad7295527e186f063c2.tar.bz2
* generic/tclCompile.c:
* tests/compile.test: bad command count on TCL_OUT_LINE_COMPILE [Bug 705406] (Don Porter). Backport from 8.5a0
Diffstat (limited to 'generic')
-rw-r--r--generic/tclCompile.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/generic/tclCompile.c b/generic/tclCompile.c
index 704178b..19f1e25 100644
--- a/generic/tclCompile.c
+++ b/generic/tclCompile.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclCompile.c,v 1.43 2003/02/19 14:33:39 msofer Exp $
+ * RCS: @(#) $Id: tclCompile.c,v 1.43.2.1 2003/03/19 22:53:11 msofer Exp $
*/
#include "tclInt.h"
@@ -989,12 +989,19 @@ TclCompileScript(interp, script, numBytes, nested, envPtr)
&& (cmdPtr->compileProc != NULL)
&& !(cmdPtr->flags & CMD_HAS_EXEC_TRACES)
&& !(iPtr->flags & DONT_COMPILE_CMDS_INLINE)) {
+ int savedNumCmds = envPtr->numCommands;
+
code = (*(cmdPtr->compileProc))(interp, &parse,
envPtr);
if (code == TCL_OK) {
goto finishCommand;
} else if (code == TCL_OUT_LINE_COMPILE) {
- /* do nothing */
+ /*
+ * Restore numCommands to its correct value, removing
+ * any commands compiled before TCL_OUT_LINE_COMPILE
+ * [Bug 705406]
+ */
+ envPtr->numCommands = savedNumCmds;
} else { /* an error */
/*
* There was a compilation error, the last