From 8c692383f3cc9278102cdfa45fa10863f4c20ce5 Mon Sep 17 00:00:00 2001 From: Sam Parker Date: Fri, 13 Jan 2017 14:36:09 +0000 Subject: [PATCH] [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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291903 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/ARMAttributeParser.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Support/ARMAttributeParser.cpp b/lib/Support/ARMAttributeParser.cpp index 5d9b2306b9a..6ab072d683d 100644 --- a/lib/Support/ARMAttributeParser.cpp +++ b/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"; -- 2.50.1