diff options
Diffstat (limited to 'llvm/lib/Object/Decompressor.cpp')
-rw-r--r-- | llvm/lib/Object/Decompressor.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/llvm/lib/Object/Decompressor.cpp b/llvm/lib/Object/Decompressor.cpp index 53b8e846e5f..11efd857d1a 100644 --- a/llvm/lib/Object/Decompressor.cpp +++ b/llvm/lib/Object/Decompressor.cpp @@ -77,10 +77,15 @@ bool Decompressor::isGnuStyle(StringRef Name) { } bool Decompressor::isCompressed(const object::SectionRef &Section) { - StringRef Name; - if (Section.getName(Name)) - return false; - return Section.isCompressed() || isGnuStyle(Name); + if (Section.isCompressed()) + return true; + + Expected<StringRef> SecNameOrErr = Section.getName(); + if (SecNameOrErr) + return isGnuStyle(*SecNameOrErr); + + consumeError(SecNameOrErr.takeError()); + return false; } bool Decompressor::isCompressedELFSection(uint64_t Flags, StringRef Name) { |