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

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 13 06:47:04 PST 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL291903: [ARM] Fix ubig32_t read in ARMAttributeParser (authored by sam_parker).

Changed prior to commit:
  https://reviews.llvm.org/D28669?vs=84296&id=84298#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D28669

Files:
  llvm/trunk/lib/Support/ARMAttributeParser.cpp


Index: llvm/trunk/lib/Support/ARMAttributeParser.cpp
===================================================================
--- llvm/trunk/lib/Support/ARMAttributeParser.cpp
+++ llvm/trunk/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.84298.patch
Type: text/x-patch
Size: 767 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170113/b0fc8f79/attachment.bin>


More information about the llvm-commits mailing list