[ARM] Fix ubig32_t read in ARMAttributeParser

Now using support functions to read data instead of trying to
perform casts.

Differential Revision: https://reviews.llvm.org/D28669

llvm-svn: 291903
This commit is contained in:
Sam Parker 2017-01-13 14:36:09 +00:00
parent d6a1831ea7
commit 2178370e53
1 changed files with 3 additions and 3 deletions

View File

@ -685,9 +685,9 @@ void ARMAttributeParser::Parse(ArrayRef<uint8_t> Section, bool isLittle) {
unsigned SectionNumber = 0;
while (Offset < Section.size()) {
uint32_t SectionLength = isLittle ?
*reinterpret_cast<const support::ulittle32_t*>(Section.data() + Offset) :
*reinterpret_cast<const support::ubig32_t*>(Section.data() + Offset);
uint32_t SectionLength =
isLittle ? support::endian::read32le(Section.data() + Offset)
: support::endian::read32be(Section.data() + Offset);
if (SW) {
SW->startLine() << "Section " << ++SectionNumber << " {\n";