summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/ARMAttributeParser.cpp
diff options
context:
space:
mode:
authorSam Parker <sam.parker@arm.com>2017-01-13 14:36:09 +0000
committerSam Parker <sam.parker@arm.com>2017-01-13 14:36:09 +0000
commit2178370e534d12d24ed505610b7569e12de5e3ad (patch)
tree8037ff8da00e3cf4ad13f33b6a73349bca9384d5 /llvm/lib/Support/ARMAttributeParser.cpp
parentd6a1831ea79cd41a9ad24b49dfb1155b0ac3b4fe (diff)
downloadbcm5719-llvm-2178370e534d12d24ed505610b7569e12de5e3ad.tar.gz
bcm5719-llvm-2178370e534d12d24ed505610b7569e12de5e3ad.zip
[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
Diffstat (limited to 'llvm/lib/Support/ARMAttributeParser.cpp')
-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