summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2016-12-01 20:13:10 (GMT)
committerdgp <dgp@users.sourceforge.net>2016-12-01 20:13:10 (GMT)
commit72c1f925db451c491dbe57887feed9b5460dd24e (patch)
treea3ad3b6198cf39f4a3aba30bb87b91bc87d218c6 /generic
parente42f5d61b2902fac51008c50902cd763c4d96b18 (diff)
downloadtcl-72c1f925db451c491dbe57887feed9b5460dd24e.zip
tcl-72c1f925db451c491dbe57887feed9b5460dd24e.tar.gz
tcl-72c1f925db451c491dbe57887feed9b5460dd24e.tar.bz2
Reports from NSF that command epoch bumping isn't properly timed.
http://paste.tclers.tk/4030 Since the epoch should bump to indicate when Tcl_FindCommand() would produce a different result from the cached value, the bump ought to be connected to the state change that would have that effect. This checkin appears to be the more correct answer, and it makes the Delete path get into agreement with the Rename path. Review would be good.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclBasic.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index c1dd52d..686c292 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -3024,13 +3024,6 @@ Tcl_DeleteCommandFromToken(
Tcl_Command importCmd;
/*
- * Bump the command epoch counter. This will invalidate all cached
- * references that point to this command.
- */
-
- cmdPtr->cmdEpoch++;
-
- /*
* The code here is tricky. We can't delete the hash table entry before
* invoking the deletion callback because there are cases where the
* deletion callback needs to invoke the command (e.g. object systems such
@@ -3052,6 +3045,14 @@ Tcl_DeleteCommandFromToken(
Tcl_DeleteHashEntry(cmdPtr->hPtr);
cmdPtr->hPtr = NULL;
}
+
+ /*
+ * Bump the command epoch counter. This will invalidate all cached
+ * references that point to this command.
+ */
+
+ cmdPtr->cmdEpoch++;
+
return 0;
}
@@ -3154,6 +3155,14 @@ Tcl_DeleteCommandFromToken(
if (cmdPtr->hPtr != NULL) {
Tcl_DeleteHashEntry(cmdPtr->hPtr);
cmdPtr->hPtr = NULL;
+ /*
+ * Bump the command epoch counter. This will invalidate all cached
+ * references that point to this command.
+ */
+
+ cmdPtr->cmdEpoch++;
+
+ cmdPtr->cmdEpoch++;
}
/*