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

Binary encoding isn't fully validated #549

Open
ddcc opened this issue May 27, 2016 · 2 comments
Open

Binary encoding isn't fully validated #549

ddcc opened this issue May 27, 2016 · 2 comments

Comments

@ddcc
Copy link
Contributor

ddcc commented May 27, 2016

During parsing of binary-encoded files, the input isn't fully validated against the specification.

For example, the specification states that "known sections may [must?] not appear out of order", however, this isn't currently being verified. Most likely, an assertion failure will occur during parsing, but this isn't guaranteed.

Likewise, the specification states that "each section is optional and may appear at most once", but since sections are parsed in a loop, the latest section of a specific type will take precedence, plus any side effects from previous occurrences of that section type.

@ddcc
Copy link
Contributor Author

ddcc commented May 27, 2016

Additionally, the description of the names section states that "a validation error in this section does not cause validation for the whole module to fail, and is instead treated as if the section was absent". This seems to be imply that a rollback is necessary on encountering a validation error?

It also states that the count of function_names may be greater or less than the actual number of functions. Currently (post-#546), the existing implementation checks that the count is equal to the number of functions.

@kripken
Copy link
Member

kripken commented May 30, 2016

Yes, we should fix all these. I haven't made it a priority personally since it needs tests, and tests should arrive eventually in the spec repo, so not urgent to fix before that. However, if anyone wants to fix earlier, that's great of course.

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

No branches or pull requests

2 participants