summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2014-12-18 22:00:08 (GMT)
committerdgp <dgp@users.sourceforge.net>2014-12-18 22:00:08 (GMT)
commit40d7215d54e63c1f2c3c064b112c078e1edf6fba (patch)
tree4d707cd4cdecc2a181690d158265fa90bb2fd070 /generic
parent0b46203902b6bab47f2b10309f367e56fbf834ad (diff)
downloadtcl-40d7215d54e63c1f2c3c064b112c078e1edf6fba.zip
tcl-40d7215d54e63c1f2c3c064b112c078e1edf6fba.tar.gz
tcl-40d7215d54e63c1f2c3c064b112c078e1edf6fba.tar.bz2
No need for varvList any more.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclCompCmds.c27
1 files changed, 2 insertions, 25 deletions
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c
index 6fa1e71..1bafbe2 100644
--- a/generic/tclCompCmds.c
+++ b/generic/tclCompCmds.c
@@ -1549,13 +1549,6 @@ TclCompileForeachCmd(
DefineLineInformation; /* TIP #280 */
/*
- * We parse the variable list argument words and create two arrays:
- * varvList[i] points to array of var names in i-th var list.
- */
-
- const char ***varvList;
-
- /*
* If the foreach command isn't in a procedure, don't compile it inline:
* the payoff is too small.
*/
@@ -1583,26 +1576,18 @@ TclCompileForeachCmd(
}
/*
- * Allocate storage for the varcList and varvList arrays if necessary.
- */
-
- numLists = (numWords - 2)/2;
- varvList = (const char ***) TclStackAlloc(interp,
- numLists * sizeof(const char **));
- memset((char*) varvList, 0, numLists * sizeof(const char **));
-
- /*
* Create and initialize the ForeachInfo and ForeachVarList data
* structures describing this command. Then create a AuxData record
* pointing to the ForeachInfo structure.
*/
+ numLists = (numWords - 2)/2;
infoPtr = (ForeachInfo *) ckalloc((unsigned)
sizeof(ForeachInfo) + numLists*sizeof(ForeachVarList *));
infoPtr->numLists = 0; /* Count this up as we go */
/*
- * Break up each var list and set the varcList and varvList arrays. Don't
+ * Parse each var list into sequence of var names. Don't
* compile the foreach inline if any var name needs substitutions or isn't
* a scalar, or if any var list needs substitutions.
*/
@@ -1669,8 +1654,6 @@ TclCompileForeachCmd(
* nonoverlapping foreach loops, they don't share any temps.
*/
- code = TCL_OK;
-
tempVar = TclFindCompiledLocal(NULL, 0, 1, procPtr);
infoPtr->firstValueTemp = tempVar;
for (loopIndex = 1; loopIndex < numLists; loopIndex++) {
@@ -1797,12 +1780,6 @@ TclCompileForeachCmd(
if (varListObj) {
Tcl_DecrRefCount(varListObj);
}
- for (loopIndex = 0; loopIndex < numLists; loopIndex++) {
- if (varvList[loopIndex] != NULL) {
- ckfree((char *) varvList[loopIndex]);
- }
- }
- TclStackFree(interp, (void *)varvList);
return code;
}