diff options
author | Miguel Sofer <miguel.sofer@gmail.com> | 2003-05-09 13:42:38 (GMT) |
---|---|---|
committer | Miguel Sofer <miguel.sofer@gmail.com> | 2003-05-09 13:42:38 (GMT) |
commit | bf03b26a12344067b24baca9bc4617566c721b13 (patch) | |
tree | 5cffdf6d9686de27cf87a1144ab442a5833d2216 | |
parent | d51857ebee06efd6c8b787e97a2cc344cd5f74b1 (diff) | |
download | tcl-bf03b26a12344067b24baca9bc4617566c721b13.zip tcl-bf03b26a12344067b24baca9bc4617566c721b13.tar.gz tcl-bf03b26a12344067b24baca9bc4617566c721b13.tar.bz2 |
fix for [Bug 735055]
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | generic/tclCompile.c | 4 | ||||
-rw-r--r-- | tests/compile.test | 4 |
3 files changed, 12 insertions, 3 deletions
@@ -1,3 +1,10 @@ +2003-05-09 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. + 2003-05-09 Donal K. Fellows <fellowsd@cs.man.ac.uk> * generic/tclCmdMZ.c (Tcl_ReturnObjCmd): The array of strings diff --git a/generic/tclCompile.c b/generic/tclCompile.c index b492e3b..c781814 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.47 2003/04/18 21:54:51 dgp Exp $ + * RCS: @(#) $Id: tclCompile.c,v 1.48 2003/05/09 13:42:39 msofer Exp $ */ #include "tclInt.h" @@ -930,6 +930,7 @@ TclCompileScript(interp, script, numBytes, envPtr) && !(cmdPtr->flags & CMD_HAS_EXEC_TRACES) && !(iPtr->flags & DONT_COMPILE_CMDS_INLINE)) { int savedNumCmds = envPtr->numCommands; + int savedCodeNext = envPtr->codeNext; code = (*(cmdPtr->compileProc))(interp, &parse, envPtr); @@ -942,6 +943,7 @@ TclCompileScript(interp, script, numBytes, envPtr) * [Bug 705406] */ 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 9c7347c..8559b24 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.26 2003/03/19 22:24:15 msofer Exp $ +# RCS: @(#) $Id: compile.test,v 1.27 2003/05/09 13:42:40 msofer Exp $ package require tcltest 2 namespace import -force ::tcltest::* @@ -123,7 +123,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 |