Debian Codegraph @

crt/aws-c-common/verification/cbmc/stubs/s_remove_entry_override.c

raw symbols SCIP
1 #include <aws/common/hash_table.h>
2 #include <aws/common/math.h>
3 #include <aws/common/private/hash_table_impl.h>
4 #include <aws/common/string.h>
5
6 #include <limits.h>
7 #include <proof_helpers/make_common_data_structures.h>
8 #include <proof_helpers/utils.h>
9 #include <stdio.h>
10 #include <stdlib.h>
11
12 /* Clears an entry. Does _not_ invoke destructor callbacks.
13 * Returns the last slot touched (note that if we wrap, we'll report an index
14 * lower than the original entry's index)
15 */
16 size_t __CPROVER_file_local_hash_table_c_s_remove_entry(
17 struct hash_table_state *state,
18 struct hash_table_entry *entry) {
19 AWS_PRECONDITION(hash_table_state_is_valid(state));
20 AWS_PRECONDITION(state->entry_count > 0);
21 AWS_PRECONDITION(
22 entry >= &state->slots[0] && entry < &state->slots[state->size],
23 "Input hash_table_entry [entry] pointer must point in the available slots.");
24 state->entry_count--;
25
26 /* This stub does not update any slots. */
27
28 size_t index;
29 __CPROVER_assume(index <= state->size);
30
31 AWS_RETURN_WITH_POSTCONDITION(index, hash_table_state_is_valid(state) && index <= state->size);
32 }