diff options
Diffstat (limited to 'llvm/tools/dsymutil/MachODebugMapParser.cpp')
-rw-r--r-- | llvm/tools/dsymutil/MachODebugMapParser.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/tools/dsymutil/MachODebugMapParser.cpp b/llvm/tools/dsymutil/MachODebugMapParser.cpp index cd427cb1d94..bd29f004b09 100644 --- a/llvm/tools/dsymutil/MachODebugMapParser.cpp +++ b/llvm/tools/dsymutil/MachODebugMapParser.cpp @@ -265,8 +265,13 @@ void MachODebugMapParser::loadMainBinarySymbols( // are the only ones that need to be queried because the address // of common data won't be described in the debug map. All other // addresses should be fetched for the debug map. - if (!(Sym.getFlags() & SymbolRef::SF_Global) || Sym.getSection(Section) || - Section == MainBinary.section_end() || Section->isText()) + if (!(Sym.getFlags() & SymbolRef::SF_Global)) + continue; + ErrorOr<section_iterator> SectionOrErr = Sym.getSection(); + if (!SectionOrErr) + continue; + Section = *SectionOrErr; + if (Section == MainBinary.section_end() || Section->isText()) continue; uint64_t Addr = Sym.getValue(); ErrorOr<StringRef> NameOrErr = Sym.getName(); |