This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] libObject: Don't include the name the size of custom sections
ClosedPublic

Authored by sbc100 on Apr 12 2018, 10:18 AM.

Diff Detail

Event Timeline

sbc100 created this revision.Apr 12 2018, 10:18 AM
sbc100 edited the summary of this revision. (Show Details)Apr 12 2018, 10:21 AM
sbc100 added a reviewer: yurydelendik.
yurydelendik accepted this revision.Apr 12 2018, 11:38 AM

Looks good to me. I would also add error check to ensure that name fits into the section.

lib/Object/WasmObjectFile.cpp
184

It will be nice to add an error check to see if Size < Ptr - NameStart

This revision is now accepted and ready to land.Apr 12 2018, 11:38 AM
sbc100 added inline comments.Apr 12 2018, 12:04 PM
lib/Object/WasmObjectFile.cpp
184

I generaly we don't yes handle that kind of malformedness gracefully. Probably we could want to change all the uses of Ptr (such as the argument to readString) to contain the end ptr too. That is probably separate change.

sbc100 updated this revision to Diff 142250.Apr 12 2018, 1:26 PM
sbc100 edited the summary of this revision. (Show Details)
  • update tests
This revision was automatically updated to reflect the committed changes.