From 91fcbdbc1ce2836f8df968af33ce13bff991a90b Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 12 Jan 2009 16:50:03 +0000 Subject: * 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]. --- ChangeLog | 13 +++++++++++++ generic/tclBasic.c | 12 +----------- 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 + + * 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 * 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 -- cgit v0.12