diff options
| author | Miguel Sofer <miguel.sofer@gmail.com> | 2002-02-26 17:26:25 (GMT) |
|---|---|---|
| committer | Miguel Sofer <miguel.sofer@gmail.com> | 2002-02-26 17:26:25 (GMT) |
| commit | a218f1b580ad718af74ca939560f0dfae2ac797a (patch) | |
| tree | b05d6bea4104b271a8d740afbc9f21cd848c09d6 | |
| parent | cd2b3a996e8a6ba8c9cc86221b77b44dbbe87c6b (diff) | |
| download | tcl-a218f1b580ad718af74ca939560f0dfae2ac797a.zip tcl-a218f1b580ad718af74ca939560f0dfae2ac797a.tar.gz tcl-a218f1b580ad718af74ca939560f0dfae2ac797a.tar.bz2 | |
bugfix to the bugfix to the new [for] compiled code
| -rw-r--r-- | ChangeLog | 7 | ||||
| -rw-r--r-- | generic/tclCompCmds.c | 8 |
2 files changed, 12 insertions, 3 deletions
@@ -1,3 +1,10 @@ +2002-02-26 Miguel Sofer <msofer@users.sourceforge.net> + + * generic/tclCmpCmds.c: (bugfix to the bugfix, hopefully the last) + Bugfix to the new [for] compiling code: was setting a exceptArray + parameter using another param which wasn't yet initialised, thus + filling it with noise. + 2002-02-25 Andreas Kupries <andreas_kupries@users.sourceforge.net> * mac/tclMacSock.c (TcpGetOptionProc): Changed to recognize the diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c index c3b731f..2b8f398 100644 --- a/generic/tclCompCmds.c +++ b/generic/tclCompCmds.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: tclCompCmds.c,v 1.26 2002/02/25 14:15:10 msofer Exp $ + * RCS: @(#) $Id: tclCompCmds.c,v 1.27 2002/02/26 17:26:25 msofer Exp $ */ #include "tclInt.h" @@ -605,8 +605,9 @@ TclCompileForCmd(interp, parsePtr, envPtr) * Compile the "next" subcommand. */ - envPtr->currStackDepth = savedStackDepth; nextCodeOffset = (envPtr->codeNext - envPtr->codeStart); + + envPtr->currStackDepth = savedStackDepth; code = TclCompileCmdWord(interp, nextTokenPtr+1, nextTokenPtr->numComponents, envPtr); envPtr->currStackDepth = savedStackDepth + 1; @@ -619,7 +620,7 @@ TclCompileForCmd(interp, parsePtr, envPtr) } envPtr->exceptArrayPtr[nextRange].numCodeBytes = (envPtr->codeNext - envPtr->codeStart) - - envPtr->exceptArrayPtr[nextRange].codeOffset; + - nextCodeOffset; TclEmitOpcode(INST_POP, envPtr); envPtr->currStackDepth = savedStackDepth; @@ -629,6 +630,7 @@ TclCompileForCmd(interp, parsePtr, envPtr) */ testCodeOffset = (envPtr->codeNext - envPtr->codeStart); + jumpDist = testCodeOffset - jumpEvalCondFixup.codeOffset; if (TclFixupForwardJump(envPtr, &jumpEvalCondFixup, jumpDist, 127)) { bodyCodeOffset += 3; |
