`vector_algorithms.cpp`: avoid unaligned access by AlexGuteniev · Pull Request #5760 · microsoft/STL · GitHub
Skip to content

vector_algorithms.cpp: avoid unaligned access#5760

Merged
StephanTLavavej merged 1 commit into
microsoft:mainfrom
AlexGuteniev:fear-of-misaligned
Oct 10, 2025
Merged

vector_algorithms.cpp: avoid unaligned access#5760
StephanTLavavej merged 1 commit into
microsoft:mainfrom
AlexGuteniev:fear-of-misaligned

Conversation

@AlexGuteniev

@AlexGuteniev AlexGuteniev commented Oct 4, 2025

Copy link
Copy Markdown
Contributor

Fixes #5741

The unaligned access here could happen without misalignment from the user side: the original arrays could be of a type with a smaller alignment.

I have not found other instances of unaligned access due to integral cast

@AlexGuteniev AlexGuteniev requested a review from a team as a code owner October 4, 2025 07:42
@github-project-automation github-project-automation Bot moved this to Initial Review in STL Code Reviews Oct 4, 2025
@AlexGuteniev

Copy link
Copy Markdown
Contributor Author

@StephanTLavavej StephanTLavavej added the bug Something isn't working label Oct 4, 2025
@StephanTLavavej StephanTLavavej self-assigned this Oct 4, 2025
@StephanTLavavej StephanTLavavej removed their assignment Oct 8, 2025
@StephanTLavavej StephanTLavavej moved this from Initial Review to Ready To Merge in STL Code Reviews Oct 8, 2025
@StephanTLavavej

Copy link
Copy Markdown
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej moved this from Ready To Merge to Merging in STL Code Reviews Oct 9, 2025
@StephanTLavavej StephanTLavavej merged commit f3eff99 into microsoft:main Oct 10, 2025
39 checks passed
@github-project-automation github-project-automation Bot moved this from Merging to Done in STL Code Reviews Oct 10, 2025
@StephanTLavavej

Copy link
Copy Markdown
Member

@AlexGuteniev AlexGuteniev deleted the fear-of-misaligned branch October 10, 2025 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vector_algorithms.cpp: undefined behavior

2 participants