From d97ec1c0ce07013113e6c93a1997cfab150a3348 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Fri, 16 Nov 2012 21:36:10 +0000 Subject: [PATCH] Make sure architectures are obeyed for skinny mach files. llvm-svn: 168205 --- lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp index 92afb42..3e6cd1ef 100644 --- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -562,6 +562,11 @@ ObjectFileMachO::ParseHeader () ArchSpec mach_arch(eArchTypeMachO, m_header.cputype, m_header.cpusubtype); + // Check if the module has a required architecture + const ArchSpec &module_arch = module_sp->GetArchitecture(); + if (module_arch.IsValid() && !module_arch.IsExactMatch(mach_arch)) + return false; + if (SetModulesArchitecture (mach_arch)) { const size_t header_and_lc_size = m_header.sizeofcmds + MachHeaderSizeFromMagic(m_header.magic); -- 2.7.4