about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2025-10-19 17:46:26 +0200
committerptitSeb <sebastien.chev@gmail.com>2025-10-19 17:46:26 +0200
commitb76e26dc84c643e4e72788342e83c4b6379335e1 (patch)
treee36389a303a119203d0d7ce11ef9444daf8a3645
parented267b1a05264dc9f28619812aac3d4c5d702a93 (diff)
downloadbox64-b76e26dc84c643e4e72788342e83c4b6379335e1.tar.gz
box64-b76e26dc84c643e4e72788342e83c4b6379335e1.zip
[BOX32] Fixed some old issue with hash useage
-rw-r--r--src/box32.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/box32.c b/src/box32.c
index 1bac0faa..f3204b05 100644
--- a/src/box32.c
+++ b/src/box32.c
@@ -18,7 +18,7 @@ KHASH_MAP_INIT_STR(strings, ptr_t);
 static kh_from_t*   hash_from = NULL;
 static kh_to_t*     hash_to = NULL;
 #define HASH_MSK    0xf000000f
-#define HASH_VAL    0x00ffffff
+#define HASH_VAL    0x007fffff
 #define HASH_SHIFT  4
 static uint32_t     hash_cnt = 1;
 static pthread_rwlock_t hash_lock = {0};
@@ -88,7 +88,7 @@ uintptr_t from_hash_d(ulong_t l) {
 
 // Convert from 64bits to hash key, creating it if needed
 ulong_t to_hash(uintptr_t p) {
-    if((p<0x100000000LL) && ((p&HASH_MSK)!=HASH_MSK))
+    if((p>0x100000000LL) && ((p&HASH_MSK)!=HASH_MSK))
         return (ulong_t)p;
     if(p==0xffffffffffffffffll) {
         return 0xffffffff;
@@ -120,7 +120,7 @@ ulong_t to_hash(uintptr_t p) {
 
 // Convert from 64bits to hash key and delete the entry from both hash table
 ulong_t to_hash_d(uintptr_t p) {
-    if((p<0x100000000LL) && ((p&HASH_MSK)!=HASH_MSK))
+    if((p>0x100000000LL) && ((p&HASH_MSK)!=HASH_MSK))
         return (ulong_t)p;
     if(p==0xffffffffffffffffll)
         return 0xffffffff;