summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/Support/ARMAttributeParser.cpp6
1 files changed, 3 insertions, 3 deletions
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<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";
OpenPOWER on IntegriCloud