summaryrefslogtreecommitdiffstats
path: root/contrib/restricted/aws/aws-c-common/source/hash_table.c
diff options
context:
space:
mode:
authorthegeorg <[email protected]>2022-05-11 12:12:06 +0300
committerthegeorg <[email protected]>2022-05-11 12:12:06 +0300
commit62f93da087b2fec0f89979fd11ac4d754ca36253 (patch)
tree67bf8ceb55e2d079f3575f9a7373584ad407d2a5 /contrib/restricted/aws/aws-c-common/source/hash_table.c
parent8d55620139d4309265409767f873ba83fe046418 (diff)
Update aws-c-common and aws-c-io
* Update `contrib/restricted/aws/aws-c-io` to 0.11.0 * Backport cJSON symbol renaming logic from aws-sdk-cpp upstream ref:396829235a01ed34888651ee38ebd76c95510d6b
Diffstat (limited to 'contrib/restricted/aws/aws-c-common/source/hash_table.c')
-rw-r--r--contrib/restricted/aws/aws-c-common/source/hash_table.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/contrib/restricted/aws/aws-c-common/source/hash_table.c b/contrib/restricted/aws/aws-c-common/source/hash_table.c
index a8125a2df11..88926e48f97 100644
--- a/contrib/restricted/aws/aws-c-common/source/hash_table.c
+++ b/contrib/restricted/aws/aws-c-common/source/hash_table.c
@@ -222,7 +222,6 @@ int aws_hash_table_init(
AWS_PRECONDITION(alloc != NULL);
AWS_PRECONDITION(hash_fn != NULL);
AWS_PRECONDITION(equals_fn != NULL);
-
struct hash_table_state template;
template.hash_fn = hash_fn;
template.equals_fn = equals_fn;
@@ -715,6 +714,13 @@ int aws_hash_table_foreach(
for (struct aws_hash_iter iter = aws_hash_iter_begin(map); !aws_hash_iter_done(&iter); aws_hash_iter_next(&iter)) {
int rv = callback(context, &iter.element);
+ if (rv & AWS_COMMON_HASH_TABLE_ITER_ERROR) {
+ int error = aws_last_error();
+ if (error == AWS_ERROR_SUCCESS) {
+ aws_raise_error(AWS_ERROR_UNKNOWN);
+ }
+ return AWS_OP_ERR;
+ }
if (rv & AWS_COMMON_HASH_TABLE_ITER_DELETE) {
aws_hash_iter_delete(&iter, false);
@@ -1000,7 +1006,7 @@ bool aws_hash_callback_string_eq(const void *a, const void *b) {
AWS_PRECONDITION(aws_string_is_valid(a));
AWS_PRECONDITION(aws_string_is_valid(b));
bool rval = aws_string_eq(a, b);
- AWS_RETURN_WITH_POSTCONDITION(rval, aws_c_string_is_valid(a) && aws_c_string_is_valid(b));
+ AWS_RETURN_WITH_POSTCONDITION(rval, aws_string_is_valid(a) && aws_string_is_valid(b));
}
void aws_hash_callback_string_destroy(void *a) {