Now using support functions to read data instead of trying to
perform casts.
Differential Revision: https://reviews.llvm.org/D28669
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291903
91177308-0d34-0410-b5e6-
96231b3b80d8
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";