(HASHFUNCTION): Insure nonnegative hash even if addresses are negative.
authorRichard Stallman <rms@gnu.org>
Mon, 15 Feb 1993 07:18:09 +0000 (07:18 +0000)
committerRichard Stallman <rms@gnu.org>
Mon, 15 Feb 1993 07:18:09 +0000 (07:18 +0000)
From-SVN: r3473

gcc/objc/objc-act.c

index 908b10d28ef432201d50cbc3c58769558c560da8..6429dfc4c77e307ece153e63a260e252afe00496 100644 (file)
@@ -2973,7 +2973,7 @@ build_ivar_reference (id)
 #define HASH_ALLOC_LIST_SIZE   170
 #define ATTR_ALLOC_LIST_SIZE   170
 #define SIZEHASHTABLE          257
-#define HASHFUNCTION(key)      ((int)key >> 2)         /* divide by 4 */
+#define HASHFUNCTION(key)      ((int)key & 0x7fffffff) /* make positive */
 
 static void
 hash_init ()