From: Richard Kenner Date: Sun, 5 May 1996 17:13:21 +0000 (-0400) Subject: (hash_value_for_key): Prevent endless loop when 0 was stored in a X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1139608504938dc663efb1643d5708185d8858ff;p=gcc.git (hash_value_for_key): Prevent endless loop when 0 was stored in a hashtable. From-SVN: r11926 --- diff --git a/gcc/objc/hash.c b/gcc/objc/hash.c index 33912743fd8..b0245733bfb 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);