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)
commit245ed0c3c358f72b7b1c4591a0a8e1de80c0fb42 (patch)
tree7630a208d870b57ed6bca6dd298c18112c42dfbb /generic/tclHash.c
parent543703d4ee015b5c0fb7b4402dbe0701ba47945f (diff)
downloadtcl-245ed0c3c358f72b7b1c4591a0a8e1de80c0fb42.zip
tcl-245ed0c3c358f72b7b1c4591a0a8e1de80c0fb42.tar.gz
tcl-245ed0c3c358f72b7b1c4591a0a8e1de80c0fb42.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;
}