diff options
author | Vitaly Buka <vitalybuka@google.com> | 2018-12-18 22:23:30 +0000 |
---|---|---|
committer | Vitaly Buka <vitalybuka@google.com> | 2018-12-18 22:23:30 +0000 |
commit | 4e4920694cae642b6eea869d1f7475c61741ec44 (patch) | |
tree | 573c97577cb4472a1f106d663f0f5f77096f2990 /llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp | |
parent | 608d128c4224ddadb63341750633253795163370 (diff) | |
download | bcm5719-llvm-4e4920694cae642b6eea869d1f7475c61741ec44.tar.gz bcm5719-llvm-4e4920694cae642b6eea869d1f7475c61741ec44.zip |
[asan] Restore ODR-violation detection on vtables
Summary:
unnamed_addr is still useful for detecting of ODR violations on vtables
Still unnamed_addr with lld and --icf=safe or --icf=all can trigger false
reports which can be avoided with --icf=none or by using private aliases
with -fsanitize-address-use-odr-indicator
Reviewers: eugenis
Reviewed By: eugenis
Subscribers: kubamracek, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D55799
llvm-svn: 349555
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp')
-rw-r--r-- | llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp index 769cd2343e0..2ede46774b2 100644 --- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp @@ -2199,8 +2199,8 @@ bool AddressSanitizerModule::InstrumentGlobals(IRBuilder<> &IRB, Module &M, bool // ODR check is not useful for the following, but we see false reports // caused by linker optimizations. - if (NewGlobal->hasLocalLinkage() || NewGlobal->hasGlobalUnnamedAddr() || - NewGlobal->hasLinkOnceODRLinkage() || NewGlobal->hasWeakODRLinkage()) { + if (NewGlobal->hasLocalLinkage() || NewGlobal->hasLinkOnceODRLinkage() || + NewGlobal->hasWeakODRLinkage()) { ODRIndicator = ConstantExpr::getIntToPtr(ConstantInt::get(IntptrTy, -1), IRB.getInt8PtrTy()); } else if (UseOdrIndicator) { |