diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2016-09-26 13:24:48 +0000 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2016-09-26 13:24:48 +0000 |
| commit | f8f74c7dc1421ec39a66f14701e985a365481dff (patch) | |
| tree | 90990ff674864f9902e8d7af358059c906a69966 | |
| parent | 16f4ebbb9163cfb1725e9fd211ec5d90861940a7 (diff) | |
| download | bcm5719-llvm-f8f74c7dc1421ec39a66f14701e985a365481dff.tar.gz bcm5719-llvm-f8f74c7dc1421ec39a66f14701e985a365481dff.zip | |
tsan: simplify meta mapping
Don't xor user address with kAppMemXor in meta mapping.
The only purpose of kAppMemXor is to raise shadow for ~0 user addresses,
so that they don't map to ~0 (which would cause overlap between
user memory and shadow).
For meta mapping we explicitly add kMetaShadowBeg offset,
so we don't need to additionally raise meta shadow.
llvm-svn: 282403
| -rw-r--r-- | compiler-rt/lib/tsan/rtl/tsan_platform.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler-rt/lib/tsan/rtl/tsan_platform.h b/compiler-rt/lib/tsan/rtl/tsan_platform.h index f9c9eec82a3..506fa60f1b8 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_platform.h +++ b/compiler-rt/lib/tsan/rtl/tsan_platform.h @@ -662,9 +662,8 @@ template<typename Mapping> u32 *MemToMetaImpl(uptr x) { DCHECK(IsAppMem(x)); #ifndef SANITIZER_GO - return (u32*)(((((x) & ~(Mapping::kAppMemMsk | (kMetaShadowCell - 1))) - ^ Mapping::kAppMemXor) / kMetaShadowCell * kMetaShadowSize) - | Mapping::kMetaShadowBeg); + return (u32*)(((((x) & ~(Mapping::kAppMemMsk | (kMetaShadowCell - 1)))) / + kMetaShadowCell * kMetaShadowSize) | Mapping::kMetaShadowBeg); #else return (u32*)(((x & ~(kMetaShadowCell - 1)) / \ kMetaShadowCell * kMetaShadowSize) | Mapping::kMetaShadowBeg); |

