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

Fix accidental closure in Regex.Replace #50512

Merged
merged 1 commit into from
Apr 1, 2021

Conversation

stephentoub
Copy link
Member

And sprinkle some "static" around to help avoid this in the future.

And sprinkle some "static" around to help avoid this in the future.
@ghost
Copy link

ghost commented Mar 31, 2021

Tagging subscribers to this area: @eerhardt, @pgovind
See info in area-owners.md if you want to be subscribed.

Issue Details

And sprinkle some "static" around to help avoid this in the future.

Author: stephentoub
Assignees: -
Labels:

area-System.Text.RegularExpressions

Milestone: -

{
state.segments.Add(state.input.AsMemory(match.Index + match.Length, state.prevat - match.Index - match.Length));
state.prevat = match.Index;
state.segments.Add(evaluator(match).AsMemory());
state.segments.Add(state.evaluator(match).AsMemory());
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the fix.

Copy link

Choose a reason for hiding this comment

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

Just curious about how you found this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Wednesdays are a busy meeting day for me, and I find my mind is able to stay more focused on them if I give it little mindless side projects, like walking in ILSpy through all "DisplayClass"es in all of netcoreapp looking for ones that don't belong :)

Copy link
Member

Choose a reason for hiding this comment

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

Next task is to look a dumps all day.

Copy link

@pgovind pgovind left a comment

Choose a reason for hiding this comment

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

Pretty straightforward. LGTM!

Copy link
Member

@eerhardt eerhardt left a comment

Choose a reason for hiding this comment

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

LGTM

@stephentoub stephentoub merged commit 9e9fb06 into dotnet:main Apr 1, 2021
@stephentoub stephentoub deleted the regexclosure branch April 1, 2021 00:05
@iSazonov
Copy link
Contributor

iSazonov commented Apr 2, 2021

The use of "static" is not so obvious. Do you already have an idea to make an analyzer for this?

@ghost ghost locked as resolved and limited conversation to collaborators May 2, 2021
@karelz karelz added this to the 6.0.0 milestone May 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants