diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-09-02 12:11:01 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-09-02 12:11:01 (GMT) |
commit | 68caa10ca3562292a830860aaa37289795fe68b7 (patch) | |
tree | 7754802e4bd11708a3c967883846c3930f57ed4b /generic/tclObj.c | |
parent | d84492f3906d20d05b547a4fa90286fe0a59bb37 (diff) | |
download | tcl-68caa10ca3562292a830860aaa37289795fe68b7.zip tcl-68caa10ca3562292a830860aaa37289795fe68b7.tar.gz tcl-68caa10ca3562292a830860aaa37289795fe68b7.tar.bz2 |
Proposed patch for [d4e7780ca1681cd095dbd81fe264feff75c988f7|d4e7780ca1], by Gustaf Neumann
Diffstat (limited to 'generic/tclObj.c')
-rw-r--r-- | generic/tclObj.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/generic/tclObj.c b/generic/tclObj.c index 628c3a7..661ab48 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -4219,7 +4219,10 @@ TclSetCmdNameObj( const char *name; if (objPtr->typePtr == &tclCmdNameType) { - return; + resPtr = objPtr->internalRep.twoPtrValue.ptr1; + if (resPtr->cmdPtr == cmdPtr) { + return; + } } cmdPtr->refCount++; @@ -4397,7 +4400,9 @@ SetCmdNameFromAny( cmdPtr->refCount++; resPtr = objPtr->internalRep.twoPtrValue.ptr1; if ((objPtr->typePtr == &tclCmdNameType) - && resPtr && (resPtr->refCount == 1)) { + && resPtr != NULL + && (resPtr->refCount == 1) + ) { /* * Reuse the old ResolvedCmdName struct instead of freeing it */ |