diff options
Diffstat (limited to 'llvm/tools/llvm-pdbutil/InputFile.cpp')
-rw-r--r-- | llvm/tools/llvm-pdbutil/InputFile.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/tools/llvm-pdbutil/InputFile.cpp b/llvm/tools/llvm-pdbutil/InputFile.cpp index bd23bfdbe31..8380054b631 100644 --- a/llvm/tools/llvm-pdbutil/InputFile.cpp +++ b/llvm/tools/llvm-pdbutil/InputFile.cpp @@ -66,12 +66,13 @@ getModuleDebugStream(PDBFile &File, StringRef &ModuleName, uint32_t Index) { static inline bool isCodeViewDebugSubsection(object::SectionRef Section, StringRef Name, BinaryStreamReader &Reader) { - StringRef SectionName; - if (Section.getName(SectionName)) - return false; - - if (SectionName != Name) + if (Expected<StringRef> NameOrErr = Section.getName()) { + if (*NameOrErr != Name) + return false; + } else { + consumeError(NameOrErr.takeError()); return false; + } Expected<StringRef> ContentsOrErr = Section.getContents(); if (!ContentsOrErr) { |