Release script: correctly symlink clang-tools-extra into the build (PR22765)
[oota-llvm.git] / tools / dsymutil / MachODebugMapParser.cpp
index cd427cb1d94a820ae47f308f7580397b103961d9..bd29f004b0973f2de122b53645aed7df4ff8b053 100644 (file)
@@ -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();