Skip to content

Conversation

@tlively
Copy link
Member

@tlively tlively commented Apr 24, 2024

The new wat parser currently considers itself to be at the end of the file
whenever it cannot lex another token. This is not quite right, but fixing it
causes parser errors because of the extra null character we were appending to
files when we read them. This null character is not useful since we can already
read files as std::string, which always has an implicit null character, so
remove it. Clean up some users of read_file while we're at it.

The new wat parser currently considers itself to be at the end of the file
whenever it cannot lex another token. This is not quite right, but fixing it
causes parser errors because of the extra null character we were appending to
files when we read them. This null character is not useful since we can already
read files as `std::string`, which always has an implicit null character, so
remove it. Clean up some users of `read_file` while we're at it.
@tlively tlively requested a review from kripken April 24, 2024 22:34
Copy link
Member Author

tlively commented Apr 24, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @tlively and the rest of your teammates on Graphite Graphite

<< "': Input file too large: " << insize
<< " bytes. Try rebuilding in 64-bit mode.";
}
T input(size_t(insize) + (binary == Flags::Binary ? 0 : 1), '\0');
Copy link
Member

Choose a reason for hiding this comment

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

Please add a comment here, this looks mysterious by itself I think...

@tlively tlively enabled auto-merge (squash) April 24, 2024 23:38
@tlively tlively merged commit aa93162 into main Apr 24, 2024
@tlively tlively deleted the no-extra-nul branch April 24, 2024 23:59
@gkdn gkdn mentioned this pull request Aug 31, 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