mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-22 07:24:47 +00:00
[Object, MachO] Don't crash on invalid MachO load commands.
Summary: Currently all load commands are parsed in MachOObjectFile constructor. If the next load command cannot be parsed, or if command size is too small, properly report it through the error code and fail to construct the object, instead of crashing the program. Test Plan: regression test suite Reviewers: rafael, filcab Subscribers: llvm-commits git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239080 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -28,6 +28,7 @@ enum class object_error {
|
||||
parse_failed,
|
||||
unexpected_eof,
|
||||
bitcode_section_not_found,
|
||||
macho_small_load_command,
|
||||
};
|
||||
|
||||
inline std::error_code make_error_code(object_error e) {
|
||||
|
Reference in New Issue
Block a user