Skip to content

Commit

Permalink
dynarray: make UBSan happy
Browse files Browse the repository at this point in the history
  • Loading branch information
Akaricchi committed Aug 30, 2024
1 parent 3dcb4a9 commit 7541c20
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/dynarray.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ void _dynarray_set_elements(dynarray_size_t sizeof_element, DynamicArray *darr,
}

void _dynarray_filter(dynarray_size_t sizeof_element, DynamicArray *darr, dynarray_filter_predicate_t predicate, void *userdata) {
if(UNLIKELY(!darr->data)) {
return;
}

char *p = darr->data;
char *end = p + sizeof_element * darr->num_elements;
dynarray_size_t shift = 0;
Expand Down

0 comments on commit 7541c20

Please sign in to comment.