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(compiler): Read custom sections in full #1243

Merged
merged 1 commit into from
May 22, 2022

Conversation

ospencer
Copy link
Member

Previously we relied on OCaml's input to read the custom section from a module. If all the bytes were not read, we skipped the section entirely. This swaps to really_input to ensure we read the entire section.

@ospencer ospencer requested a review from a team May 22, 2022 03:01
@ospencer ospencer self-assigned this May 22, 2022
Copy link
Member

@phated phated left a comment

Choose a reason for hiding this comment

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

Just one question. Preemptive approval 👍

} else {
process(tl);
};
really_input(inchan, bytes, 0, realsize);
Copy link
Member

Choose a reason for hiding this comment

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

Is it okay that this will raise if we can't read it all?

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed! If all the bytes aren't there (when the module reported that they were) means the module is corrupted.

@ospencer ospencer merged commit f8a0891 into main May 22, 2022
@ospencer ospencer deleted the oscar/fix-reading-custom-sections branch May 22, 2022 22:09
@github-actions github-actions bot mentioned this pull request May 31, 2022
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