This is an archive of the discontinued LLVM Phabricator instance.

[Object, MachO] Don't crash on parsing invalid MachO header.
ClosedPublic

Authored by samsonov on Jun 3 2015, 4:44 PM.

Details

Summary

Instead, properly report this error from MachOObjectFile constructor.

Diff Detail

Event Timeline

samsonov updated this revision to Diff 27071.Jun 3 2015, 4:44 PM
samsonov retitled this revision from to [Object, MachO] Don't crash on parsing invalid MachO header..
samsonov updated this object.
samsonov edited the test plan for this revision. (Show Details)
samsonov added a reviewer: rafael.
samsonov added a subscriber: Unknown Object (MLST).
filcab added a subscriber: filcab.Jun 3 2015, 5:02 PM

LGTM

test/Object/macho-invalid.test
41

If you're expecting to add a lot of these, we might want to start putting the expected error next to the respective run line, instead of all the run lines and then all the errors.
(Both are ok with me, we can also wait until it gets unreadable and then change)

samsonov added inline comments.Jun 3 2015, 5:32 PM
test/Object/macho-invalid.test
41

Right, I'm addressing this in subsequent http://reviews.llvm.org/D10230

samsonov accepted this revision.Jun 4 2015, 12:49 PM
samsonov added a reviewer: samsonov.

Submitted in r239078.

This revision is now accepted and ready to land.Jun 4 2015, 12:49 PM
samsonov closed this revision.Jun 4 2015, 12:50 PM