forked from OSchip/llvm-project
[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
This commit is contained in:
parent
d6a1831ea7
commit
2178370e53
|
@ -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";
|
||||
|
|
Loading…
Reference in New Issue