gcconfig.h - Add weak attribute to avoid __data_start undefined messages on dlopen
[mono.git] / mono / utils / mono-internal-hash.c
index cd11dc5f9631409bf8a034894aaa5edb9b552017..10ee6de5d5904459a8356e41caaf6caf0ccae971 100644 (file)
@@ -93,7 +93,8 @@ mono_internal_hash_table_insert (MonoInternalHashTable *table,
 {
        gint hash = HASH (key, table->hash_func, table->size);
 
-       g_assert(table->key_extract(value) == key);
+       g_assert (table->key_extract(value) == key);
+       g_assert (*(table->next_value (value)) == NULL);
        g_assert (mono_internal_hash_table_lookup (table, key) == NULL);
 
        *(table->next_value (value)) = table->table[hash];
@@ -115,9 +116,11 @@ mono_internal_hash_table_remove (MonoInternalHashTable *table, gpointer key)
             value = table->next_value (*value)) {
                if (table->key_extract (*value) == key)
                {
-                       *value = table->next_value (*value);
+                       *value = *(table->next_value (*value));
                        --table->num_entries;
                        return;
                }
        }
+
+       g_assert (0);
 }