From a4212c244a272b0b6f1153cdc330f1854f20d267 Mon Sep 17 00:00:00 2001 From: Timur Iskhodzhanov Date: Tue, 8 Jul 2014 13:18:58 +0000 Subject: [PATCH] [ASan/Win] Don't instrument private COMDAT globals until PR20244 is properly fixed llvm-svn: 212530 --- llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp index 65f769c..8f9355c 100644 --- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp @@ -946,6 +946,13 @@ bool AddressSanitizerModule::ShouldInstrumentGlobal(GlobalVariable *G) { return false; } + // Don't instrument private COMDAT globals on Windows until PR20244 (linkage + // of vftables with RTTI) is properly fixed. + llvm::Triple TargetTriple(G->getParent()->getTargetTriple()); + if (G->hasComdat() && G->getLinkage() == GlobalVariable::PrivateLinkage && + TargetTriple.isWindowsMSVCEnvironment()) + return false; + if (G->hasSection()) { StringRef Section(G->getSection()); // Ignore the globals from the __OBJC section. The ObjC runtime assumes -- 2.7.4