Skip to content

Fix stack overflow in CSharpStringIndentationService#61978

Merged
sharwell merged 1 commit intodotnet:mainfrom
sharwell:large-string
Jun 20, 2022
Merged

Fix stack overflow in CSharpStringIndentationService#61978
sharwell merged 1 commit intodotnet:mainfrom
sharwell:large-string

Conversation

@sharwell
Copy link
Copy Markdown
Contributor

@sharwell sharwell commented Jun 17, 2022

Convert a recursive-descent algorithm to iterating over a separate work stack.

Fixes AB#1542623

@sharwell sharwell requested a review from a team as a code owner June 17, 2022 00:33
@ghost ghost added the Area-IDE label Jun 17, 2022
@sharwell sharwell marked this pull request as draft June 17, 2022 00:42
@sharwell

This comment was marked as resolved.

@sharwell sharwell marked this pull request as ready for review June 17, 2022 15:34
// If necessary, push the current node so we can pick back up after processing the child
if (i < childList.Count - 1)
{
nodeStack.Push((node, i + 1));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is it important to keep the traveral order as DFS here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It appears so. Otherwise, I'm not sure what order the result array will end up in.

@sharwell sharwell merged commit e118907 into dotnet:main Jun 20, 2022
@sharwell sharwell deleted the large-string branch June 20, 2022 23:46
@ghost ghost added this to the Next milestone Jun 20, 2022
@RikkiGibson RikkiGibson modified the milestones: Next, 17.3 P3 Jun 28, 2022
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.

3 participants