Skip to content

Navigation Menu

Sign in
Sign up

Avoid recursion when MultiReader advances past empty readers - #8662

Open
cuishuang wants to merge 1 commit into
google:master from
cuishuang:master
Open

Avoid recursion when MultiReader advances past empty readers #8662
cuishuang wants to merge 1 commit into
google:master from
cuishuang:master

Conversation

@cuishuang

@cuishuang cuishuang commented Sep 5, 2026

Copy link
Copy Markdown

Addresses #8661

Summary

  • Replace recursive EOF advancement in MultiReader.read(char[], int, int) with an iterative loop.
  • Add a regression test covering 100,000 consecutive empty CharSource instances.

This prevents StackOverflowError for valid concatenations containing many empty sources and matches the existing iterative behavior in MultiInputStream.

Copy link
Copy Markdown
Member

Thanks! This closely parallels the fix for #2996 back in 2017.

cuishuang reacted with thumbs up emoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /