diff options
| author | Miguel Sofer <miguel.sofer@gmail.com> | 2003-03-19 22:24:10 (GMT) |
|---|---|---|
| committer | Miguel Sofer <miguel.sofer@gmail.com> | 2003-03-19 22:24:10 (GMT) |
| commit | 386ceef8ca2806e35149bf954b86d77cf4f1740e (patch) | |
| tree | 84cb20700da4902ac04d31caeea4b7cd5140da17 /generic/tclCompile.c | |
| parent | e2745cb5c131daf4d1689b792adcb95eb74859e5 (diff) | |
| download | tcl-386ceef8ca2806e35149bf954b86d77cf4f1740e.zip tcl-386ceef8ca2806e35149bf954b86d77cf4f1740e.tar.gz tcl-386ceef8ca2806e35149bf954b86d77cf4f1740e.tar.bz2 | |
* generic/tclCompile.c:
* tests/compile.test: bad command count on TCL_OUT_LINE_COMPILE
[Bug 705406] (Don Porter).
Diffstat (limited to 'generic/tclCompile.c')
| -rw-r--r-- | generic/tclCompile.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/generic/tclCompile.c b/generic/tclCompile.c index 6812331..fb7443e 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.45 2003/03/19 16:51:42 dgp Exp $ + * RCS: @(#) $Id: tclCompile.c,v 1.46 2003/03/19 22:24:14 msofer Exp $ */ #include "tclInt.h" @@ -929,12 +929,19 @@ TclCompileScript(interp, script, numBytes, 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 |
