From 255e0a50dce41cdbdb200cbb5714d9247467bd63 Mon Sep 17 00:00:00 2001 From: Miguel Sofer Date: Tue, 26 Feb 2002 17:26:25 +0000 Subject: bugfix to the bugfix to the new [for] compiled code --- ChangeLog | 7 +++++++ generic/tclCompCmds.c | 8 +++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5ebd04a..10bafbf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2002-02-26 Miguel Sofer + + * 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 * 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; -- cgit v0.12