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

Adding some validation of custom sections (e.g. linking section) #1166

Open
sbc100 opened this issue Sep 24, 2019 · 3 comments
Open

Adding some validation of custom sections (e.g. linking section) #1166

sbc100 opened this issue Sep 24, 2019 · 3 comments

Comments

@sbc100
Copy link
Member

sbc100 commented Sep 24, 2019

wabt currently knows how to parse some custom sections, such as the linking section which are outside of the core spec.

I'd like to add some amount of validation there but its not clear where best to do this. Presumably not in ReadBinaryIr? Would it make sense to add this to ValidateModule? (disabled with the existing --ignore-custom-section-errors option)

@binji
Copy link
Member

binji commented Sep 25, 2019

It probably won't work in ValidateModule, since that would require you to read the data into IR first.

I think the way that fits best with the current design would be to create a separate class for validating linking info. It would have a collection of functions that map directly to the callbacks in binary-reader.h. Then anyone who wants to validate that custom section can forward the calls. It's a bit clumsy with the current design, but that would mean you could share validation between wasm2wat and wasm-objdump, for example.

@sbc100
Copy link
Member Author

sbc100 commented Sep 25, 2019

And it would make sense to you to run it as part of wasm-validate?

@binji
Copy link
Member

binji commented Sep 25, 2019

Maybe not by default, but I think it makes sense as a flag.

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

No branches or pull requests

2 participants