summaryrefslogtreecommitdiffstats
path: root/generic/tclHash.c
diff options
context:
space:
mode:
authorsebres <sebres@users.sourceforge.net>2019-05-21 11:22:36 (GMT)
committersebres <sebres@users.sourceforge.net>2019-05-21 11:22:36 (GMT)
commitd6f4d3d00d09d00c1112ae20f067ee4cfb4c7ee1 (patch)
tree7630a208d870b57ed6bca6dd298c18112c42dfbb /generic/tclHash.c
parentcc25f59b14793bb945043ac65ebfca08d50979b5 (diff)
downloadtcl-d6f4d3d00d09d00c1112ae20f067ee4cfb4c7ee1.zip
tcl-d6f4d3d00d09d00c1112ae20f067ee4cfb4c7ee1.tar.gz
tcl-d6f4d3d00d09d00c1112ae20f067ee4cfb4c7ee1.tar.bz2
cherry-picing of [3f693cdfe9c875c4] to be more compatible across version, resolve mistake with "key objects/pointers comparison by the hash entry" firstly introduced there.
Diffstat (limited to 'generic/tclHash.c')
-rw-r--r--generic/tclHash.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/generic/tclHash.c b/generic/tclHash.c
index 5d6ea86..837a167 100644
--- a/generic/tclHash.c
+++ b/generic/tclHash.c
@@ -324,7 +324,10 @@ CreateHashEntry(
continue;
}
#endif
- if (compareKeysProc((VOID *) key, hPtr)) {
+ /* if keys pointers or values are equal */
+ if (((void *) key == hPtr->key.oneWordValue)
+ || compareKeysProc((VOID *) key, hPtr)
+ ) {
if (newPtr) {
*newPtr = 0;
}