diff options
Diffstat (limited to 'llvm/tools/dsymutil/DwarfStreamer.cpp')
| -rw-r--r-- | llvm/tools/dsymutil/DwarfStreamer.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/tools/dsymutil/DwarfStreamer.cpp b/llvm/tools/dsymutil/DwarfStreamer.cpp index 9461f4de819..8fc29851786 100644 --- a/llvm/tools/dsymutil/DwarfStreamer.cpp +++ b/llvm/tools/dsymutil/DwarfStreamer.cpp @@ -31,7 +31,11 @@ static Optional<object::SectionRef> getSectionByName(const object::ObjectFile &Obj, StringRef SecName) { for (const object::SectionRef &Section : Obj.sections()) { StringRef SectionName; - Section.getName(SectionName); + if (Expected<StringRef> NameOrErr = Section.getName()) + SectionName = *NameOrErr; + else + consumeError(NameOrErr.takeError()); + SectionName = SectionName.substr(SectionName.find_first_not_of("._")); if (SectionName != SecName) continue; |

