summaryrefslogtreecommitdiffstats
path: root/generic/tclCompCmds.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2014-12-18 22:25:27 (GMT)
committerdgp <dgp@users.sourceforge.net>2014-12-18 22:25:27 (GMT)
commitfee272d8e8c4275d53f447cf243b898e9e97f611 (patch)
tree528aa97a58f5f41652d75a3e6f993dcfc6abb900 /generic/tclCompCmds.c
parent712798923a79fd0bd4a4020b31a06b21b139bdb1 (diff)
downloadtcl-fee272d8e8c4275d53f447cf243b898e9e97f611.zip
tcl-fee272d8e8c4275d53f447cf243b898e9e97f611.tar.gz
tcl-fee272d8e8c4275d53f447cf243b898e9e97f611.tar.bz2
A bit more tidying...
Diffstat (limited to 'generic/tclCompCmds.c')
-rw-r--r--generic/tclCompCmds.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c
index 0030f62..002012e 100644
--- a/generic/tclCompCmds.c
+++ b/generic/tclCompCmds.c
@@ -1540,6 +1540,7 @@ TclCompileForeachCmd(
* foreach command. Stored in a AuxData
* record in the ByteCode. */
Tcl_Token *tokenPtr, *bodyTokenPtr;
+ Tcl_Token token[2];
unsigned char *jumpPc;
JumpFixup jumpFalseFixup;
int jumpBackDist, jumpBackOffset, infoIndex, range;
@@ -1593,6 +1594,8 @@ TclCompileForeachCmd(
*/
varListObj = Tcl_NewObj();
+ token[0].type = TCL_TOKEN_SIMPLE_WORD;
+ token[0].numComponents = 1;
for (i = 0, tokenPtr = parsePtr->tokenPtr;
i < numWords-1;
i++, tokenPtr = TokenAfter(tokenPtr)) {
@@ -1623,12 +1626,9 @@ TclCompileForeachCmd(
for (j = 0; j < numVars; j++) {
Tcl_Obj *varNameObj;
- Tcl_Token token[2];
int varIndex, isSimple, isScalar;
Tcl_ListObjIndex(NULL, varListObj, j, &varNameObj);
- token[0].type = TCL_TOKEN_SIMPLE_WORD;
- token[0].numComponents = 1;
token[1].start = Tcl_GetStringFromObj(varNameObj, &token[1].size);
PushVarNameWord(interp, token, envPtr, TCL_CREATE_VAR,
&varIndex, &isSimple, &isScalar, 0 /* ignored */);
@@ -1638,13 +1638,11 @@ TclCompileForeachCmd(
}
varListPtr->varIndexes[j] = varIndex;
}
-
Tcl_SetObjLength(varListObj, 0);
}
/*
- * We will compile the foreach command. Reserve (numLists + 1) temporary
- * variables:
+ * Reserve (numLists + 1) temporary variables:
* - numLists temps to hold each value list
* - 1 temp for the loop counter (index of next element in each list)
*