Skip to content

Commit

Permalink
Merging r261513:
Browse files Browse the repository at this point in the history
------------------------------------------------------------------------
r261513 | mohit.bhakkad | 2016-02-22 11:46:28 +0530 (Mon, 22 Feb 2016) | 7 lines

[MSan] Make unaligned load/store functions compatible for both endians

Reviewers: eugenis

Subscribers: jaydeep, sagar, llvm-commits

Differential Revision: http://reviews.llvm.org/D17371
------------------------------------------------------------------------

llvm-svn: 270396
  • Loading branch information
Mohit7 committed May 23, 2016
1 parent 7c682e0 commit 8b1075e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions compiler-rt/lib/msan/msan.cc
Original file line number Diff line number Diff line change
Expand Up @@ -580,13 +580,13 @@ u32 __msan_get_umr_origin() {
}

u16 __sanitizer_unaligned_load16(const uu16 *p) {
__msan_retval_tls[0] = *(uu16 *)MEM_TO_SHADOW((uptr)p);
*(uu16 *)&__msan_retval_tls[0] = *(uu16 *)MEM_TO_SHADOW((uptr)p);
if (__msan_get_track_origins())
__msan_retval_origin_tls = GetOriginIfPoisoned((uptr)p, sizeof(*p));
return *p;
}
u32 __sanitizer_unaligned_load32(const uu32 *p) {
__msan_retval_tls[0] = *(uu32 *)MEM_TO_SHADOW((uptr)p);
*(uu32 *)&__msan_retval_tls[0] = *(uu32 *)MEM_TO_SHADOW((uptr)p);
if (__msan_get_track_origins())
__msan_retval_origin_tls = GetOriginIfPoisoned((uptr)p, sizeof(*p));
return *p;
Expand All @@ -598,15 +598,15 @@ u64 __sanitizer_unaligned_load64(const uu64 *p) {
return *p;
}
void __sanitizer_unaligned_store16(uu16 *p, u16 x) {
u16 s = __msan_param_tls[1];
u16 s = *(uu16 *)&__msan_param_tls[1];
*(uu16 *)MEM_TO_SHADOW((uptr)p) = s;
if (s && __msan_get_track_origins())
if (uu32 o = __msan_param_origin_tls[2])
SetOriginIfPoisoned((uptr)p, (uptr)&s, sizeof(s), o);
*p = x;
}
void __sanitizer_unaligned_store32(uu32 *p, u32 x) {
u32 s = __msan_param_tls[1];
u32 s = *(uu32 *)&__msan_param_tls[1];
*(uu32 *)MEM_TO_SHADOW((uptr)p) = s;
if (s && __msan_get_track_origins())
if (uu32 o = __msan_param_origin_tls[2])
Expand Down

0 comments on commit 8b1075e

Please sign in to comment.