Skip to content

Fix begin/end for valarray crashing on empty instance - #2435

Merged
Stephan T. Lavavej (StephanTLavavej) merged 3 commits into
microsoft:mainfrom
Saalvage:main
Jan 20, 2022
Merged

Stephan T. Lavavej (StephanTLavavej) merged 3 commits into
microsoft:mainfrom
Saalvage:main

Conversation

@Saalvage

Copy link
Copy Markdown
Contributor

This issue also causes range-based for loops to break for empty valarrays.

I also added regression tests, which I hope are fine.

If there's anything wrong just tell me and I'll happily adjust!

@Saalvage
Stefan (Saalvage) requested a review from a team as a code owner December 19, 2021 01:31
@ghost

Deleted user (ghost) commented Dec 19, 2021

Copy link
Copy Markdown

CLA assistant check
All CLA requirements met.

Comment thread stl/inc/valarray

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to apply my suggestions which clean up pre-existing weirdness in <valarray>.

Comment thread stl/inc/valarray Outdated
Comment thread stl/inc/valarray Outdated
Comment thread stl/inc/valarray
Comment thread tests/tr1/tests/valarray/test.cpp
@CaseyCarter Casey Carter (CaseyCarter) added the bug Something isn't working label Dec 19, 2021
There's no reason to make friend declarations private.
Comment thread tests/tr1/tests/valarray/test.cpp
Comment thread tests/tr1/tests/valarray/test.cpp
@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
Stephan T. Lavavej (StephanTLavavej) merged commit 20fea3f into microsoft:main Jan 20, 2022
@StephanTLavavej

Copy link
Copy Markdown
Member

Thanks for fixing this bug - and congratulations on your first microsoft/STL commit! 🎉 😻 🚀

This will ship as part of VS 2022 17.2 Preview 2.

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.

5 participants