summaryrefslogtreecommitdiffstats
path: root/generic/tclCompCmds.c
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2007-07-11 21:27:27 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2007-07-11 21:27:27 (GMT)
commit95089adb47fee26e3c41c8d88e3dfd356d48dcc2 (patch)
treeece8e7586529705cc7d47f00e42666eb3ed271cc /generic/tclCompCmds.c
parent2c819f71e6342fb519e96c5cb316a08b63adeaa9 (diff)
downloadtcl-95089adb47fee26e3c41c8d88e3dfd356d48dcc2.zip
tcl-95089adb47fee26e3c41c8d88e3dfd356d48dcc2.tar.gz
tcl-95089adb47fee26e3c41c8d88e3dfd356d48dcc2.tar.bz2
2007-07-11 Miguel Sofer <msofer@users.sf.net>
* generic/tclCompCmds.c (TclCompileWhileCmd): * generic/tclCompile.c (TclCompileScript): Corrected faulty avoidance of INST_START_CMD when the first opcode in a script is within a loop (as produced by 'while 1'), so that the corresponding command is properly counted [Bug 1752146].
Diffstat (limited to 'generic/tclCompCmds.c')
-rw-r--r--generic/tclCompCmds.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c
index c50849b..8176295 100644
--- a/generic/tclCompCmds.c
+++ b/generic/tclCompCmds.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclCompCmds.c,v 1.112 2007/06/28 21:10:38 patthoyts Exp $
+ * RCS: @(#) $Id: tclCompCmds.c,v 1.113 2007/07/11 21:27:28 msofer Exp $
*/
#include "tclInt.h"
@@ -4400,6 +4400,12 @@ TclCompileWhileCmd(
TclEmitForwardJump(envPtr, TCL_UNCONDITIONAL_JUMP, &jumpEvalCondFixup);
testCodeOffset = 0; /* Avoid compiler warning. */
} else {
+ /*
+ * Make sure that the first command in the body is preceded by an
+ * INST_START_CMD, and hence counted properly. [Bug 1752146]
+ */
+
+ envPtr->atCmdStart = 0;
testCodeOffset = CurrentOffset(envPtr);
}