Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<regex>: Fix pointer-size constructor of basic_regex and remove error_parse #5211

Merged
merged 3 commits into from
Jan 14, 2025

Conversation

frederick-vs-ja
Copy link
Contributor

@frederick-vs-ja frederick-vs-ja commented Dec 28, 2024

error_parse is a non-reserved identifier that is not used by the standard library. I think it's better to remove its use. Perhaps it would also be better to remove error_syntax, but see #438.

Per [re.regex.construct]/6, the call to the pointer-size constructor of basic_regex should be well-defined when p is null and len is 0. This PR makes such case accepted and makes some UB case diagnosed with _STL_VERIFY.

Drive-by: Strengthening exception specification of regex_error::code.

@frederick-vs-ja frederick-vs-ja requested a review from a team as a code owner December 28, 2024 12:58
@StephanTLavavej StephanTLavavej added the bug Something isn't working label Jan 4, 2025
@StephanTLavavej StephanTLavavej self-assigned this Jan 4, 2025
@StephanTLavavej StephanTLavavej added the regex Everyone's favorite header label Jan 8, 2025
stl/inc/regex Outdated Show resolved Hide resolved
@StephanTLavavej
Copy link
Member

Thanks! 😻 I pushed a commit to avoid checking in IDL=0, please meow if you have concerns.

@StephanTLavavej StephanTLavavej removed their assignment Jan 12, 2025
@StephanTLavavej StephanTLavavej self-assigned this Jan 13, 2025
@StephanTLavavej
Copy link
Member

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

@StephanTLavavej StephanTLavavej merged commit 30dd267 into microsoft:main Jan 14, 2025
39 checks passed
@StephanTLavavej
Copy link
Member

Thanks for fixing this lurking problem of construction from empty ranges! 🎉 😸 🐈‍⬛

@frederick-vs-ja frederick-vs-ja deleted the regex-null-zero branch January 14, 2025 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working regex Everyone's favorite header
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants