diff options
author | Mohit K. Bhakkad <mohit.bhakkad@gmail.com> | 2016-05-23 07:04:33 +0000 |
---|---|---|
committer | Mohit K. Bhakkad <mohit.bhakkad@gmail.com> | 2016-05-23 07:04:33 +0000 |
commit | 969db4d3dc047df59e3e81f1f071665322a58e33 (patch) | |
tree | 99e2c3d5467cc20c1c18c07c89979734a5dbd7bb | |
parent | 73231f7a4e95e5c24b06a15c6db794375eb41e82 (diff) | |
download | compiler-rt-969db4d3dc047df59e3e81f1f071665322a58e33.tar.gz |
Merging r261982:
------------------------------------------------------------------------
r261982 | mohit.bhakkad | 2016-02-26 12:14:10 +0530 (Fri, 26 Feb 2016) | 8 lines
[MSan] Endianness should not matter while printing a byte
Reviewers: eugenis
Subscribers: jaydeep, sagar, llvm-commits
Differential Revision: http://reviews.llvm.org/D17264
Differential Revision: http://reviews.llvm.org/D17563
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/branches/release_38@270400 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/msan/msan.cc | 7 | ||||
-rw-r--r-- | lib/msan/msan_report.cc | 4 | ||||
-rw-r--r-- | test/msan/msan_print_shadow3.cc | 2 |
3 files changed, 2 insertions, 11 deletions
diff --git a/lib/msan/msan.cc b/lib/msan/msan.cc index 120abbeb9..ad4491a8d 100644 --- a/lib/msan/msan.cc +++ b/lib/msan/msan.cc @@ -462,13 +462,8 @@ void __msan_dump_shadow(const void *x, uptr size) { } unsigned char *s = (unsigned char*)MEM_TO_SHADOW(x); - for (uptr i = 0; i < size; i++) { -#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ - Printf("%x%x ", s[i] & 0xf, s[i] >> 4); -#else + for (uptr i = 0; i < size; i++) Printf("%x%x ", s[i] >> 4, s[i] & 0xf); -#endif - } Printf("\n"); } diff --git a/lib/msan/msan_report.cc b/lib/msan/msan_report.cc index ddb807028..9a35c9c13 100644 --- a/lib/msan/msan_report.cc +++ b/lib/msan/msan_report.cc @@ -221,11 +221,7 @@ void DescribeMemoryRange(const void *x, uptr size) { } else { unsigned char v = *(unsigned char *)s; if (v) last_quad_poisoned = true; -#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ - Printf("%x%x", v & 0xf, v >> 4); -#else Printf("%x%x", v >> 4, v & 0xf); -#endif } // Group end. if (pos % 4 == 3 && with_origins) { diff --git a/test/msan/msan_print_shadow3.cc b/test/msan/msan_print_shadow3.cc index b29f3222d..478315279 100644 --- a/test/msan/msan_print_shadow3.cc +++ b/test/msan/msan_print_shadow3.cc @@ -6,7 +6,7 @@ int main(void) { unsigned long long x = 0; // For 8-byte alignment. - uint32_t x_s = 0x12345678U; + char x_s[4] = {0x87, 0x65, 0x43, 0x21}; __msan_partial_poison(&x, &x_s, sizeof(x_s)); __msan_print_shadow(&x, sizeof(x_s)); return 0; |