[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
diff --git a/llvm/lib/Support/ARMAttributeParser.cpp b/llvm/lib/Support/ARMAttributeParser.cpp
index 5d9b230..6ab072d 100644
--- a/llvm/lib/Support/ARMAttributeParser.cpp
+++ b/llvm/lib/Support/ARMAttributeParser.cpp
@@ -685,9 +685,9 @@
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";