diff options
author | msofer <msofer@noemail.net> | 2007-07-11 21:27:26 (GMT) |
---|---|---|
committer | msofer <msofer@noemail.net> | 2007-07-11 21:27:26 (GMT) |
commit | c5117ca497fc7c61e6ab65d2842a6d95de21ea1a (patch) | |
tree | ece8e7586529705cc7d47f00e42666eb3ed271cc /generic/tclCompCmds.c | |
parent | a15db5f7fe2a176c7001a0b6d733769887abba24 (diff) | |
download | tcl-c5117ca497fc7c61e6ab65d2842a6d95de21ea1a.zip tcl-c5117ca497fc7c61e6ab65d2842a6d95de21ea1a.tar.gz tcl-c5117ca497fc7c61e6ab65d2842a6d95de21ea1a.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].
FossilOrigin-Name: c7bb9fa5b43b763af4a380b18335342f87510b26
Diffstat (limited to 'generic/tclCompCmds.c')
-rw-r--r-- | generic/tclCompCmds.c | 8 |
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); } |