diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1996-05-05 13:13:21 -0400 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1996-05-05 13:13:21 -0400 |
commit | 1139608504938dc663efb1643d5708185d8858ff (patch) | |
tree | a85aeb577ddf63b66da86d9c51f7c7bf4994ae11 /gcc | |
parent | ff858cdf99e1d36f8e2e4324d39d98b940b9685c (diff) | |
download | gcc-1139608504938dc663efb1643d5708185d8858ff.zip gcc-1139608504938dc663efb1643d5708185d8858ff.tar.gz gcc-1139608504938dc663efb1643d5708185d8858ff.tar.bz2 |
(hash_value_for_key): Prevent endless loop when 0 was stored in a
hashtable.
From-SVN: r11926
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/objc/hash.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/objc/hash.c b/gcc/objc/hash.c index 3391274..b024573 100644 --- a/gcc/objc/hash.c +++ b/gcc/objc/hash.c @@ -1,5 +1,5 @@ /* Hash tables for Objective C internal structures - Copyright (C) 1993 Free Software Foundation, Inc. + Copyright (C) 1993, 1996 Free Software Foundation, Inc. This file is part of GNU CC. @@ -243,9 +243,10 @@ hash_value_for_key (cache_ptr cache, const void *key) if (node) do { - if ((*cache->compare_func)(node->key, key)) + if ((*cache->compare_func)(node->key, key)) { retval = node->value; - else + break; + } else node = node->next; } while (!retval && node); |