Open sbc100 opened 5 years ago
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.
And it would make sense to you to run it as part of wasm-validate
?
Maybe not by default, but I think it makes sense as a flag.
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)