summaryrefslogtreecommitdiffstats
path: root/generic/tclNamesp.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2007-03-12 19:10:49 (GMT)
committerdgp <dgp@users.sourceforge.net>2007-03-12 19:10:49 (GMT)
commit315198312f0b545b058b63918b6d0497d3f44b0c (patch)
treece31b499628b3e634f5497bec9f5b2b7160d726d /generic/tclNamesp.c
parent0a78bbbd2192fb9210fb701537a53b9bf225c8dd (diff)
downloadtcl-315198312f0b545b058b63918b6d0497d3f44b0c.zip
tcl-315198312f0b545b058b63918b6d0497d3f44b0c.tar.gz
tcl-315198312f0b545b058b63918b6d0497d3f44b0c.tar.bz2
* generic/tclNamesp.c (NsEnsembleImplementationCmd): Make efficient
* tests/namespace.test (namespace-42.8): private copy of the command prefix as we invoke the command appropriate to a particular subcommand of a particular ensemble to avoid panic due to shimmering of the List intrep. [Bug 1670091]
Diffstat (limited to 'generic/tclNamesp.c')
-rw-r--r--generic/tclNamesp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c
index 2aa4aef..34a449d 100644
--- a/generic/tclNamesp.c
+++ b/generic/tclNamesp.c
@@ -22,7 +22,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclNamesp.c,v 1.125 2007/02/08 18:43:40 dgp Exp $
+ * RCS: @(#) $Id: tclNamesp.c,v 1.126 2007/03/12 19:10:49 dgp Exp $
*/
#include "tclInt.h"
@@ -6308,8 +6308,9 @@ NsEnsembleImplementationCmd(
{
Interp *iPtr = (Interp *) interp;
int isRootEnsemble = (iPtr->ensembleRewrite.sourceObjs == NULL);
+ Tcl_Obj *copyObj = TclListObjCopy(NULL, prefixObj);
- Tcl_ListObjGetElements(NULL, prefixObj, &prefixObjc, &prefixObjv);
+ Tcl_ListObjGetElements(NULL, copyObj, &prefixObjc, &prefixObjv);
if (isRootEnsemble) {
iPtr->ensembleRewrite.sourceObjs = objv;
iPtr->ensembleRewrite.numRemovedObjs = 2;
@@ -6329,6 +6330,7 @@ NsEnsembleImplementationCmd(
memcpy(tempObjv+prefixObjc, objv+2, sizeof(Tcl_Obj *) * (objc-2));
result = Tcl_EvalObjv(interp, objc-2+prefixObjc, tempObjv,
TCL_EVAL_INVOKE);
+ Tcl_DecrRefCount(copyObj);
Tcl_DecrRefCount(prefixObj);
TclStackFree(interp);
if (isRootEnsemble) {