From dc0c9dbf405095a6483705b153f4c85c64499d4e Mon Sep 17 00:00:00 2001 From: Scott Gasch Date: Sat, 22 Aug 2026 15:27:59 -0700 Subject: Bug fixes. --- src/hash.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/hash.c') diff --git a/src/hash.c b/src/hash.c index 4b0cc0a..a29e375 100755 --- a/src/hash.c +++ b/src/hash.c @@ -67,9 +67,11 @@ Revision History: // for other processors, change the constant below. // #define CONVERT_SEARCH_DEPTH_TO_HASH_DEPTH(x) \ - ASSERT(IS_VALID_DEPTH(x)); \ - (x) >>= 4; \ - ASSERT(((x) & 0xffffff00) == 0); + do { \ + ASSERT(IS_VALID_DEPTH(x)); \ + (x) >>= 4; \ + ASSERT(((x) & 0xffffff00) == 0); \ + } while (0) #define HASH_ENTRY_IS_DIRTY(x) \ (((x).bvFlags & 0xF0) != g_cDirty) @@ -392,7 +394,7 @@ Return value: // replace the "always replace" 1st entry on the line unless it // contains mate information and is not stale. // - if (((abs(pEntry[1].iValue >= +NMATE)) && + if (((abs(pEntry[1].iValue) >= +NMATE) && (abs(iValue) < +NMATE)) && (!HASH_ENTRY_IS_DIRTY(pEntry[1]))) { @@ -405,7 +407,7 @@ Return value: pEntry[3] = pEntry[1]; } pStore = &(pEntry[1]); - + end: ASSERT(pStore != NULL); return(pStore); @@ -766,6 +768,7 @@ Return value: goto end; } } + pHash++; } end: -- cgit v1.3