Skip to content

Conversation

ethomson
Copy link
Member

Avoid sloppy aliasing in our (re-)allocation, which is undefined behavior. This has been problematic before and was helped by volatile (see b62a6a1) but that is not technically correct, and some compilers / architectures do not understand that ptr is changing due to its aliasing.

Just make git_array_alloc behave like realloc, taking a void * and returning a void *.

Avoid sloppy aliasing in our (re-)allocation, which is undefined
behavior. This has been problematic before and was helped by `volatile`
(see b62a6a1) but that is not
technically correct, and some compilers / architectures do not
understand that `ptr` is changing due to its aliasing.

Just make `git_array_alloc` behave like `realloc`, taking a `void *` and
returning a `void *`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant