summaryrefslogtreecommitdiff
path: root/tools/llvm-cxxdump
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2019-10-23 17:51:42 +0000
committerDimitry Andric <dim@FreeBSD.org>2019-10-23 17:51:42 +0000
commit1d5ae1026e831016fc29fd927877c86af904481f (patch)
tree2cdfd12620fcfa5d9e4a0389f85368e8e36f63f9 /tools/llvm-cxxdump
parente6d1592492a3a379186bfb02bd0f4eda0669c0d5 (diff)
Notes
Diffstat (limited to 'tools/llvm-cxxdump')
-rw-r--r--tools/llvm-cxxdump/llvm-cxxdump.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/llvm-cxxdump/llvm-cxxdump.cpp b/tools/llvm-cxxdump/llvm-cxxdump.cpp
index 833312655788..03e1bab9417e 100644
--- a/tools/llvm-cxxdump/llvm-cxxdump.cpp
+++ b/tools/llvm-cxxdump/llvm-cxxdump.cpp
@@ -174,7 +174,11 @@ static void dumpCXXData(const ObjectFile *Obj) {
SectionRelocMap.clear();
for (const SectionRef &Section : Obj->sections()) {
- section_iterator Sec2 = Section.getRelocatedSection();
+ Expected<section_iterator> ErrOrSec = Section.getRelocatedSection();
+ if (!ErrOrSec)
+ error(ErrOrSec.takeError());
+
+ section_iterator Sec2 = *ErrOrSec;
if (Sec2 != Obj->section_end())
SectionRelocMap[*Sec2].push_back(Section);
}