[llvm] r291903 - [ARM] Fix ubig32_t read in ARMAttributeParser
Sam Parker via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 13 06:36:09 PST 2017
Author: sam_parker
Date: Fri Jan 13 08:36:09 2017
New Revision: 291903
URL: http://llvm.org/viewvc/llvm-project?rev=291903&view=rev
Log:
[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
Modified:
llvm/trunk/lib/Support/ARMAttributeParser.cpp
Modified: llvm/trunk/lib/Support/ARMAttributeParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/ARMAttributeParser.cpp?rev=291903&r1=291902&r2=291903&view=diff
==============================================================================
--- llvm/trunk/lib/Support/ARMAttributeParser.cpp (original)
+++ llvm/trunk/lib/Support/ARMAttributeParser.cpp Fri Jan 13 08:36:09 2017
@@ -685,9 +685,9 @@ void ARMAttributeParser::Parse(ArrayRef<
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";
More information about the llvm-commits
mailing list