aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/COFFObjectFile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Object/COFFObjectFile.cpp')
-rw-r--r--llvm/lib/Object/COFFObjectFile.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/Object/COFFObjectFile.cpp b/llvm/lib/Object/COFFObjectFile.cpp
index 6e9a8eb..354b3c0 100644
--- a/llvm/lib/Object/COFFObjectFile.cpp
+++ b/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");
}