diff options
author | Anna Zaks <ganna@apple.com> | 2016-06-22 00:15:52 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2016-06-22 00:15:52 +0000 |
commit | 644d9d3a441fe115343a2ab498aa4210b6858ed6 (patch) | |
tree | 8dbf4e37363a43ced0d84d19462849fcb63ec9db /llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp | |
parent | 606c8d62fb807ef1b72f05e4341d3d1758665bbe (diff) | |
download | llvm-644d9d3a441fe115343a2ab498aa4210b6858ed6.zip llvm-644d9d3a441fe115343a2ab498aa4210b6858ed6.tar.gz llvm-644d9d3a441fe115343a2ab498aa4210b6858ed6.tar.bz2 |
[asan] Do not instrument pointers with address space attributes
Do not instrument pointers with address space attributes since we cannot track
them anyway. Instrumenting them results in false positives in ASan and a
compiler crash in TSan. (The compiler should not crash in any case, but that's
a different problem.)
llvm-svn: 273339
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp')
-rw-r--r-- | llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp index 22a26d4..287d5bf 100644 --- a/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp @@ -276,6 +276,15 @@ static bool shouldInstrumentReadWriteFromAddress(Value *Addr) { if (GV->getName() == "__llvm_gcov_ctr") return false; } + + // Do not instrument acesses from different address spaces; we cannot deal + // with them. + if (Addr) { + Type *PtrTy = cast<PointerType>(Addr->getType()->getScalarType()); + if (PtrTy->getPointerAddressSpace() != 0) + return false; + } + return true; } |