From 2178370e534d12d24ed505610b7569e12de5e3ad Mon Sep 17 00:00:00 2001 From: Sam Parker Date: Fri, 13 Jan 2017 14:36:09 +0000 Subject: [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 --- llvm/lib/Support/ARMAttributeParser.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'llvm/lib/Support/ARMAttributeParser.cpp') diff --git a/llvm/lib/Support/ARMAttributeParser.cpp b/llvm/lib/Support/ARMAttributeParser.cpp index 5d9b2306b9a..6ab072d683d 100644 --- a/llvm/lib/Support/ARMAttributeParser.cpp +++ b/llvm/lib/Support/ARMAttributeParser.cpp @@ -685,9 +685,9 @@ void ARMAttributeParser::Parse(ArrayRef Section, bool isLittle) { unsigned SectionNumber = 0; while (Offset < Section.size()) { - uint32_t SectionLength = isLittle ? - *reinterpret_cast(Section.data() + Offset) : - *reinterpret_cast(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"; -- cgit v1.2.3