| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
#include <aws/common/private/hash_table_impl.h> |
| 7 |
#include <proof_helpers/make_common_data_structures.h> |
| 8 |
#include <proof_helpers/nondet.h> |
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
void hash_iterator_string_string_generator(struct aws_hash_iter *new_iter, const struct aws_hash_iter *old_iter) { |
| 19 |
(void)old_iter; |
| 20 |
if (new_iter->status == AWS_HASH_ITER_STATUS_READY_FOR_USE) { |
| 21 |
new_iter->element.key = ensure_string_is_allocated_nondet_length(); |
| 22 |
__CPROVER_assume(aws_string_is_valid(new_iter->element.key)); |
| 23 |
new_iter->element.value = ensure_string_is_allocated_nondet_length(); |
| 24 |
__CPROVER_assume(aws_string_is_valid(new_iter->element.value)); |
| 25 |
} |
| 26 |
} |
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
void hash_find_string_string_generator( |
| 33 |
const struct aws_hash_table *map, |
| 34 |
const void *key, |
| 35 |
struct aws_hash_element *p_elem) { |
| 36 |
if (p_elem) { |
| 37 |
p_elem->key = ensure_string_is_allocated_nondet_length(); |
| 38 |
__CPROVER_assume(aws_string_is_valid(p_elem->key)); |
| 39 |
p_elem->value = ensure_string_is_allocated_nondet_length(); |
| 40 |
__CPROVER_assume(aws_string_is_valid(p_elem->value)); |
| 41 |
} |
| 42 |
} |
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
void hash_iterator_unbacked_string_string_generator( |
| 51 |
struct aws_hash_iter *new_iter, |
| 52 |
const struct aws_hash_iter *old_iter) { |
| 53 |
(void)old_iter; |
| 54 |
if (new_iter->status == AWS_HASH_ITER_STATUS_READY_FOR_USE) { |
| 55 |
new_iter->element.key = malloc(sizeof(struct aws_string)); |
| 56 |
new_iter->element.value = malloc(sizeof(struct aws_string)); |
| 57 |
} |
| 58 |
} |
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
void hash_find_unbacked_string_string_generator( |
| 67 |
const struct aws_hash_table *map, |
| 68 |
const void *key, |
| 69 |
struct aws_hash_element *p_elem) { |
| 70 |
p_elem->key = malloc(sizeof(struct aws_string)); |
| 71 |
p_elem->value = malloc(sizeof(struct aws_string)); |
| 72 |
} |