summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2017-03-14 08:07:52 +0000
committerpatrick <patrick@openbsd.org>2017-03-14 08:07:52 +0000
commit1cb66ada17adf0954eaadba4d02ec2470365a3ac (patch)
tree521159d8f39562a43fffd680147eb5a71709b9b1 /gnu/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp
parentMark the sshd_config UsePrivilegeSeparation option as deprecated, (diff)
downloadwireguard-openbsd-1cb66ada17adf0954eaadba4d02ec2470365a3ac.tar.xz
wireguard-openbsd-1cb66ada17adf0954eaadba4d02ec2470365a3ac.zip
Import LLVM 4.0.0 release including clang and lld.
Diffstat (limited to 'gnu/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp')
-rw-r--r--gnu/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/gnu/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp b/gnu/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp
index d9659694da4..52035c79a4a 100644
--- a/gnu/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp
+++ b/gnu/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp
@@ -488,6 +488,13 @@ bool ThreadSanitizer::instrumentLoadOrStore(Instruction *I,
Value *Addr = IsWrite
? cast<StoreInst>(I)->getPointerOperand()
: cast<LoadInst>(I)->getPointerOperand();
+
+ // swifterror memory addresses are mem2reg promoted by instruction selection.
+ // As such they cannot have regular uses like an instrumentation function and
+ // it makes no sense to track them as memory.
+ if (Addr->isSwiftError())
+ return false;
+
int Idx = getMemoryAccessFuncIndex(Addr, DL);
if (Idx < 0)
return false;