[Object, MachO] Don't crash on invalid MachO segment load commands.

Summary:
Properly report the error in segment load commands from MachOObjectFile
constructor instead of crashing the program.

Adjust the test case accordingly.

Test Plan: regression test suite

Reviewers: rafael, filcab

Subscribers: llvm-commits

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239081 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Alexey Samsonov
2015-06-04 20:08:52 +00:00
parent 7e699dce03
commit 5400980e1e
4 changed files with 23 additions and 13 deletions

View File

@@ -29,6 +29,8 @@ enum class object_error {
unexpected_eof,
bitcode_section_not_found,
macho_small_load_command,
macho_load_segment_too_many_sections,
macho_load_segment_too_small,
};
inline std::error_code make_error_code(object_error e) {