[PATCH] D64402: [libunwind] Fix Unwind-EHABI.cpp:getByte on big-endian targets

Mikhail Maltsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 9 08:29:06 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL365505: [libunwind] Fix Unwind-EHABI.cpp:getByte on big-endian targets (authored by miyuki, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D64402?vs=208643&id=208699#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64402/new/

https://reviews.llvm.org/D64402

Files:
  libunwind/trunk/src/Unwind-EHABI.cpp


Index: libunwind/trunk/src/Unwind-EHABI.cpp
===================================================================
--- libunwind/trunk/src/Unwind-EHABI.cpp
+++ libunwind/trunk/src/Unwind-EHABI.cpp
@@ -31,7 +31,11 @@
 // signinficant byte.
 uint8_t getByte(const uint32_t* data, size_t offset) {
   const uint8_t* byteData = reinterpret_cast<const uint8_t*>(data);
+#ifdef __LITTLE_ENDIAN__
   return byteData[(offset & ~(size_t)0x03) + (3 - (offset & (size_t)0x03))];
+#else
+  return byteData[offset];
+#endif
 }
 
 const char* getNextWord(const char* data, uint32_t* out) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64402.208699.patch
Type: text/x-patch
Size: 573 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190709/475d3e74/attachment.bin>


More information about the llvm-commits mailing list