[PATCH] D54096: [WebAssembly] Add support for the event section

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 12 17:00:32 PST 2018


sbc100 added inline comments.


================
Comment at: tools/yaml2obj/yaml2wasm.cpp:482
-      if (Type < LastType) {
-        errs() << "Out of order section type: " << Type << "\n";
-        return 1;
----------------
aheejin wrote:
> sbc100 wrote:
> > I feel like the section ordering constraint should still be enforces somewhere,  presumably when parsing the yaml into the in-memory sections.  But we also need to enforce it when parsing the binaries in WasmObjectFile and I'm OK with that being done in a later change.
> How can we enforce it when reading file? The event section appears between global section and export section in the section order now but it has section code 0xC. In both binary and yaml files, the event section occurs before the export section, so the assumption of monotonically increasing section ordering is not valid anymore.
Exactly, but we will need to find way to validate the order none the less.   We want to be able to reject invalid files after all.  I'm not saying that should be part of this CL though.


Repository:
  rL LLVM

https://reviews.llvm.org/D54096





More information about the llvm-commits mailing list