From 00c2160b1e7f0bbd3d80f5c3551f2d5a1b7da3d2 Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 14 Jan 2009 06:10:03 +0000 Subject: * generic/tclBasic.c (Tcl_DeleteCommandFromToken): Reverted most of the substance of my 2009-01-12 commit. NULLing the objProc field of a Command when deleting it is important so that tests for certain classes of commands don't return false positives when applied to deleted command tokens. Overall change is now just replacement of a false comment with a true one. --- ChangeLog | 9 +++++++++ generic/tclBasic.c | 11 ++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8b4890c..8e612a5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-01-14 Don Porter + + * generic/tclBasic.c (Tcl_DeleteCommandFromToken): Reverted + most of the substance of my 2009-01-12 commit. NULLing the objProc + field of a Command when deleting it is important so that tests for + certain classes of commands don't return false positives when applied + to deleted command tokens. Overall change is now just replacement + of a false comment with a true one. + 2009-01-13 Jan Nijtmans * unix/tcl.m4: fix [tcl-Bug 2502365] Building of head on diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 3eab76a..e9aa6e1 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.382 2009/01/13 20:30:03 dkf Exp $ + * RCS: @(#) $Id: tclBasic.c,v 1.383 2009/01/14 06:10:04 dgp Exp $ */ #include "tclInt.h" @@ -3001,6 +3001,15 @@ Tcl_DeleteCommandFromToken( } /* + * A number of tests for particular kinds of commands are done by + * checking whether the objProc field holds a known value. Set the + * field to NULL so that such tests won't have false positives when + * applied to deleted commands. + */ + + 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