From 1f1d5fbf52282c44556d4e7c81ce8814c7fe6035 Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 26 Feb 2007 19:10:30 +0000 Subject: * generic/tclCmdAH.c (Tcl_ForeachObjCmd): Removed surplus copying of the objv array that used to be a workaround for Bug 404865. That bug is long fixed. --- ChangeLog | 6 ++++++ generic/tclCmdAH.c | 39 ++++++--------------------------------- 2 files changed, 12 insertions(+), 33 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6fda366..427c246 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-02-26 Don Porter + + * generic/tclCmdAH.c (Tcl_ForeachObjCmd): Removed surplus copying + of the objv array that used to be a workaround for Bug 404865. That bug + is long fixed. + 2007-02-24 Don Porter * generic/tclBasic.c: Use new interface in Tcl_EvalObjEx so that diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c index 79577e0..a179357 100644 --- a/generic/tclCmdAH.c +++ b/generic/tclCmdAH.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCmdAH.c,v 1.82 2007/02/06 21:15:14 dkf Exp $ + * RCS: @(#) $Id: tclCmdAH.c,v 1.83 2007/02/26 19:10:32 dgp Exp $ */ #include "tclInt.h" @@ -1699,17 +1699,6 @@ Tcl_ForeachObjCmd( int numLists; /* Count of value lists */ Tcl_Obj *bodyPtr; - /* - * We copy the argument object pointers into a local array to avoid the - * problem that "objv" might become invalid. It is a pointer into the - * evaluation stack and that stack might be grown and reallocated if the - * loop body requires a large amount of stack space. - */ - -#define NUM_ARGS 9 - Tcl_Obj *(argObjStorage[NUM_ARGS]); - Tcl_Obj **argObjv = argObjStorage; - #define STATIC_LIST_SIZE 4 int indexArray[STATIC_LIST_SIZE]; int varcListArray[STATIC_LIST_SIZE]; @@ -1731,18 +1720,6 @@ Tcl_ForeachObjCmd( } /* - * Create the object argument array "argObjv". Make sure argObjv is large - * enough to hold the objc arguments. - */ - - if (objc > NUM_ARGS) { - argObjv = (Tcl_Obj **) ckalloc(objc * sizeof(Tcl_Obj *)); - } - for (i=0 ; i