summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2019-10-01 10:02:47 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2019-10-01 10:02:47 +0000
commitc764c36fbd24735468839d3ea305331ef06198fe (patch)
treef6121389c967832d79618bf5f94537d3649c4bac
parent1d32da82490abb57dce685e75287cf163152fc0e (diff)
downloadbcm5719-llvm-c764c36fbd24735468839d3ea305331ef06198fe.tar.gz
bcm5719-llvm-c764c36fbd24735468839d3ea305331ef06198fe.zip
[obj2yaml] - Fix BB after r373315.
The success return value for data extractor's cursor should also be checked. llvm-svn: 373319
-rw-r--r--llvm/tools/obj2yaml/elf2yaml.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/tools/obj2yaml/elf2yaml.cpp b/llvm/tools/obj2yaml/elf2yaml.cpp
index b70a5dd0784..c4b6eb79d18 100644
--- a/llvm/tools/obj2yaml/elf2yaml.cpp
+++ b/llvm/tools/obj2yaml/elf2yaml.cpp
@@ -647,7 +647,9 @@ ELFDumper<ELFT>::dumpHashSection(const Elf_Shdr *Shdr) {
uint32_t NChain = Data.getU32(Cur);
if (Content.size() != (2 + NBucket + NChain) * 4) {
S->Content = yaml::BinaryRef(Content);
- return S.release();
+ if (Cur)
+ return S.release();
+ llvm_unreachable("entries were not read correctly");
}
S->Bucket.emplace(NBucket);
@@ -658,9 +660,9 @@ ELFDumper<ELFT>::dumpHashSection(const Elf_Shdr *Shdr) {
for (uint32_t &V : *S->Chain)
V = Data.getU32(Cur);
- if (!Cur)
- llvm_unreachable("entries were not read correctly");
- return S.release();
+ if (Cur)
+ return S.release();
+ llvm_unreachable("entries were not read correctly");
}
template <class ELFT>
OpenPOWER on IntegriCloud