[PATCH] D28669: [ARM] Remove ubig32_t cast from ARMAttributeParser

Sam Parker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 13 06:40:22 PST 2017


samparker updated this revision to Diff 84296.
samparker added a comment.

removed the extra bug fix and will upload as separate patch. clang-formatted the remaining.


https://reviews.llvm.org/D28669

Files:
  lib/Support/ARMAttributeParser.cpp


Index: lib/Support/ARMAttributeParser.cpp
===================================================================
--- lib/Support/ARMAttributeParser.cpp
+++ lib/Support/ARMAttributeParser.cpp
@@ -685,9 +685,9 @@
   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";


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28669.84296.patch
Type: text/x-patch
Size: 734 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170113/c6c65208/attachment.bin>


More information about the llvm-commits mailing list