diff options
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | generic/tclCompile.c | 10 | ||||
-rw-r--r-- | tests/compile.test | 4 |
3 files changed, 18 insertions, 6 deletions
@@ -1,3 +1,13 @@ +2004-03-15 Miguel Sofer <msofer@users.sf.net> + + * generic/tclCompile.c (TclCompileScript): + * tests/compile.test (compile-3.5): corrected wrong test and + behaviour in the earlier fix for [Bug 705406]; Don Porter reported + this as [Bug 735055], and provided the solution. + Fixed in HEAD on 2003-05-09, but backport to 8-4-branch was + wrongly omitted; re-reported as [Bug 916795] by Roy Terry, + diagnosed by dgp. + 2004-03-08 Vince Darley <vincentdarley@users.sourceforge.net> * generic/tclFileName.c: Fix to 'glob -path' near the root diff --git a/generic/tclCompile.c b/generic/tclCompile.c index 6c619e9..a244be9 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.2.3 2003/07/18 23:35:38 dgp Exp $ + * RCS: @(#) $Id: tclCompile.c,v 1.43.2.4 2004/03/15 20:34:13 msofer Exp $ */ #include "tclInt.h" @@ -990,6 +990,7 @@ TclCompileScript(interp, script, numBytes, nested, envPtr) && !(cmdPtr->flags & CMD_HAS_EXEC_TRACES) && !(iPtr->flags & DONT_COMPILE_CMDS_INLINE)) { int savedNumCmds = envPtr->numCommands; + unsigned char *savedCodeNext = envPtr->codeNext; code = (*(cmdPtr->compileProc))(interp, &parse, envPtr); @@ -997,11 +998,12 @@ TclCompileScript(interp, script, numBytes, nested, envPtr) goto finishCommand; } else if (code == TCL_OUT_LINE_COMPILE) { /* - * Restore numCommands to its correct value, removing - * any commands compiled before TCL_OUT_LINE_COMPILE - * [Bug 705406] + * Restore numCommands and codeNext to their correct + * values, removing any commands compiled before + * TCL_OUT_LINE_COMPILE [Bugs 705406 and 735055] */ envPtr->numCommands = savedNumCmds; + envPtr->codeNext = savedCodeNext; } else { /* an error */ /* * There was a compilation error, the last diff --git a/tests/compile.test b/tests/compile.test index 1d2ae72..9a7b3b8 100644 --- a/tests/compile.test +++ b/tests/compile.test @@ -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: compile.test,v 1.24.2.1 2003/03/19 22:53:16 msofer Exp $ +# RCS: @(#) $Id: compile.test,v 1.24.2.2 2004/03/15 20:34:13 msofer Exp $ package require tcltest 2 namespace import -force ::tcltest::* @@ -124,7 +124,7 @@ test compile-3.5 {TclCompileCatchCmd: recover from error, [Bug 705406]} { } } list [catch foo msg] $msg -} {1 {invalid command name "a"}} +} {0 1} test compile-4.1 {TclCompileForCmd: command substituted test expression} { set i 0 |