Skip to content

io.string_reader: fix needs_fill_until check - #21005

Merged
spytheman merged 1 commit into
vlang:masterfrom
daddycocoaman:io_stringreader_panic
Mar 13, 2024
Merged

spytheman merged 1 commit into
vlang:masterfrom
daddycocoaman:io_stringreader_panic

Conversation

@daddycocoaman

@daddycocoaman daddycocoaman commented Mar 12, 2024 •

Copy link
Copy Markdown
Contributor

This PR is meant to address #20998.

It changes the condition so that if you request the last byte individually, then StringReader won't fail when the current offset is equal to the length of the builder before it increases the offset to EOF.

@daddycocoaman

Copy link
Copy Markdown
Contributor Author

In my mind, the builder length should only be increased if

  • the offset is at EOF and you need to get space from that point
  • the offset is before EOF and you need get additional space past EOF

Maybe @Casper64 can add input as module creator.

@spytheman
spytheman requested a review from Casper64 March 13, 2024 11:53

@spytheman spytheman left a comment

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.

For me, the change is logical. @Casper64 what do you think?

@Casper64

Copy link
Copy Markdown
Contributor

Yeah this is better

@spytheman
spytheman merged commit 54da256 into vlang:master Mar 13, 2024
@daddycocoaman daddycocoaman changed the title fix needs_fill_until check io.string_reader: fix needs_fill_until check Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants