summaryrefslogtreecommitdiffstats
path: root/generic/tclObj.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-09-02 12:11:01 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-09-02 12:11:01 (GMT)
commit68caa10ca3562292a830860aaa37289795fe68b7 (patch)
tree7754802e4bd11708a3c967883846c3930f57ed4b /generic/tclObj.c
parentd84492f3906d20d05b547a4fa90286fe0a59bb37 (diff)
downloadtcl-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.c9
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
*/