summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2009-01-12 16:50:03 (GMT)
committerdgp <dgp@users.sourceforge.net>2009-01-12 16:50:03 (GMT)
commit91fcbdbc1ce2836f8df968af33ce13bff991a90b (patch)
tree166fd653d036a82b765eb37770c9ae92a504164e
parent8b9a703b9cb4b40327681b31f0b3c1c2ed01cea5 (diff)
downloadtcl-91fcbdbc1ce2836f8df968af33ce13bff991a90b.zip
tcl-91fcbdbc1ce2836f8df968af33ce13bff991a90b.tar.gz
tcl-91fcbdbc1ce2836f8df968af33ce13bff991a90b.tar.bz2
* generic/tclBasic.c (Tcl_DeleteCommandFromToken): One consequence
of the NRE rewrite is that there are now situations where a NULL objProc field in a Command struct is perfectly normal. Removed an outdated comment in Tcl_DeleteCommandFromToken that claimed we use (cmdPtr->objPtr == NULL) as a test of command validity. In fact we use (cmdPtr->flags & CMD_IS_DELETED) to perform that test. Also removed the setting to NULL, since any extension following the advice of the old comment is going to be broken by NRE anyway, and needs to shift to flag-based testing (or stop intruding into such internal matters). Part of [Bug 2486550].
-rw-r--r--ChangeLog13
-rw-r--r--generic/tclBasic.c12
2 files changed, 14 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 4a6cd70..c7fc057 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2009-01-12 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tclBasic.c (Tcl_DeleteCommandFromToken): One consequence
+ of the NRE rewrite is that there are now situations where a NULL
+ objProc field in a Command struct is perfectly normal. Removed an
+ outdated comment in Tcl_DeleteCommandFromToken that claimed we
+ use (cmdPtr->objPtr == NULL) as a test of command validity. In fact
+ we use (cmdPtr->flags & CMD_IS_DELETED) to perform that test.
+ Also removed the setting to NULL, since any extension following the
+ advice of the old comment is going to be broken by NRE anyway, and
+ needs to shift to flag-based testing (or stop intruding into
+ such internal matters). Part of [Bug 2486550].
+
2009-01-09 Don Porter <dgp@users.sourceforge.net>
* generic/tclStringObj.c (STRING_SIZE): Corrected failure to limit
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index ab1806e..d39f73f 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -16,7 +16,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclBasic.c,v 1.380 2009/01/09 11:21:45 dkf Exp $
+ * RCS: @(#) $Id: tclBasic.c,v 1.381 2009/01/12 16:50:03 dgp Exp $
*/
#include "tclInt.h"
@@ -3000,16 +3000,6 @@ Tcl_DeleteCommandFromToken(
}
/*
- * Mark the Command structure as no longer valid. This allows
- * TclExecuteByteCode to recognize when a Command has logically been
- * deleted and a pointer to this Command structure cached in a CmdName
- * object is invalid. TclExecuteByteCode will look up the command again in
- * the interpreter's command hashtable.
- */
-
- cmdPtr->objProc = NULL;
-
- /*
* Now free the Command structure, unless there is another reference to it
* from a CmdName Tcl object in some ByteCode code sequence. In that case,
* delay the cleanup until all references are either discarded (when a