From: Yaxun Liu Date: Thu, 15 Dec 2016 06:59:23 +0000 (+0000) Subject: Attempt to fix llvm-readobj crash on ppc64 due to r289674 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6f8d90999e451d2a7570e3614f0c569f3e809359;p=platform%2Fupstream%2Fllvm.git Attempt to fix llvm-readobj crash on ppc64 due to r289674 llvm-svn: 289777 --- diff --git a/llvm/tools/llvm-readobj/ELFDumper.cpp b/llvm/tools/llvm-readobj/ELFDumper.cpp index a200c10..801bc8e 100644 --- a/llvm/tools/llvm-readobj/ELFDumper.cpp +++ b/llvm/tools/llvm-readobj/ELFDumper.cpp @@ -2350,7 +2350,7 @@ template void ELFDumper::printAMDGPURuntimeMD() { ArrayRef Sec = unwrapOrError(Obj->getSectionContents(Shdr)); const uint32_t RuntimeMDNoteType = 7; - for (auto I = reinterpret_cast(&Sec[0]), + for (auto I = reinterpret_cast(&Sec[0]), E = I + Sec.size()/4; I != E;) { uint32_t NameSZ = I[0]; uint32_t DescSZ = I[1];