summaryrefslogtreecommitdiffstats
path: root/generic/tclNamesp.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2004-09-13 10:49:06 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2004-09-13 10:49:06 (GMT)
commit8cb023658d6e613c6a76db26b0b5568b6e0b2bb6 (patch)
treeed6601ca235b6f240172b0c9bc21eca657eb53b8 /generic/tclNamesp.c
parente1dec685e9bda26a664969e11607fabc328c582c (diff)
downloadtcl-8cb023658d6e613c6a76db26b0b5568b6e0b2bb6.zip
tcl-8cb023658d6e613c6a76db26b0b5568b6e0b2bb6.tar.gz
tcl-8cb023658d6e613c6a76db26b0b5568b6e0b2bb6.tar.bz2
Fix [Bug 1026903] by storing what ensemble the ensemble is cached for.
Diffstat (limited to 'generic/tclNamesp.c')
-rw-r--r--generic/tclNamesp.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c
index 75ba1ce..1ad687c 100644
--- a/generic/tclNamesp.c
+++ b/generic/tclNamesp.c
@@ -21,7 +21,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.52 2004/09/10 18:19:15 dgp Exp $
+ * RCS: @(#) $Id: tclNamesp.c,v 1.53 2004/09/13 10:49:19 dkf Exp $
*/
#include "tclInt.h"
@@ -156,6 +156,8 @@ typedef struct EnsembleCmdRep {
int epoch; /* Used to confirm when the data in this
* really structure matches up with the
* ensemble. */
+ Tcl_Command token; /* Reference to the comamnd for which this
+ * structure is a cache of the resolution. */
char *fullSubcmdName; /* The full (local) name of the subcommand,
* allocated with ckalloc(). */
Tcl_Obj *realPrefixObj; /* Object containing the prefix words of the
@@ -4863,7 +4865,8 @@ NsEnsembleImplementationCmd(clientData, interp, objc, objv)
EnsembleCmdRep *ensembleCmd = (EnsembleCmdRep *)
objv[1]->internalRep.otherValuePtr;
if (ensembleCmd->nsPtr == ensemblePtr->nsPtr &&
- ensembleCmd->epoch == ensemblePtr->epoch) {
+ ensembleCmd->epoch == ensemblePtr->epoch &&
+ ensembleCmd->token == ensemblePtr->token) {
prefixObj = ensembleCmd->realPrefixObj;
Tcl_IncrRefCount(prefixObj);
goto runResultingSubcommand;
@@ -5160,6 +5163,7 @@ MakeCachedEnsembleCommand(objPtr, ensemblePtr, subcommandName, prefixObjPtr)
*/
ensembleCmd->nsPtr = ensemblePtr->nsPtr;
ensembleCmd->epoch = ensemblePtr->epoch;
+ ensembleCmd->token = ensemblePtr->token;
ensemblePtr->nsPtr->refCount++;
ensembleCmd->realPrefixObj = prefixObjPtr;
length = strlen(subcommandName)+1;
@@ -5582,6 +5586,7 @@ DupEnsembleCmdRep(objPtr, copyPtr)
copyPtr->internalRep.otherValuePtr = (VOID *) ensembleCopy;
ensembleCopy->nsPtr = ensembleCmd->nsPtr;
ensembleCopy->epoch = ensembleCmd->epoch;
+ ensembleCopy->token = ensembleCmd->token;
ensembleCopy->nsPtr->refCount++;
ensembleCopy->realPrefixObj = ensembleCmd->realPrefixObj;
Tcl_IncrRefCount(ensembleCopy->realPrefixObj);