diff options
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Object/COFFObjectFile.cpp')
-rw-r--r-- | contrib/llvm-project/llvm/lib/Object/COFFObjectFile.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/contrib/llvm-project/llvm/lib/Object/COFFObjectFile.cpp b/contrib/llvm-project/llvm/lib/Object/COFFObjectFile.cpp index 6e9a8eb35dcf..354b3c0d5577 100644 --- a/contrib/llvm-project/llvm/lib/Object/COFFObjectFile.cpp +++ b/contrib/llvm-project/llvm/lib/Object/COFFObjectFile.cpp @@ -328,7 +328,14 @@ bool COFFObjectFile::isSectionBSS(DataRefImpl Ref) const { // The .debug sections are the only debug sections for COFF // (\see MCObjectFileInfo.cpp). -bool COFFObjectFile::isDebugSection(StringRef SectionName) const { +bool COFFObjectFile::isDebugSection(DataRefImpl Ref) const { + Expected<StringRef> SectionNameOrErr = getSectionName(Ref); + if (!SectionNameOrErr) { + // TODO: Report the error message properly. + consumeError(SectionNameOrErr.takeError()); + return false; + } + StringRef SectionName = SectionNameOrErr.get(); return SectionName.startswith(".debug"); } |