summaryrefslogtreecommitdiff
path: root/lib/CodeGen/SanitizerMetadata.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/SanitizerMetadata.cpp')
-rw-r--r--lib/CodeGen/SanitizerMetadata.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/CodeGen/SanitizerMetadata.cpp b/lib/CodeGen/SanitizerMetadata.cpp
index 2a338bac4b41..9848e3e452f4 100644
--- a/lib/CodeGen/SanitizerMetadata.cpp
+++ b/lib/CodeGen/SanitizerMetadata.cpp
@@ -63,7 +63,13 @@ void SanitizerMetadata::reportGlobalToASan(llvm::GlobalVariable *GV,
std::string QualName;
llvm::raw_string_ostream OS(QualName);
D.printQualifiedName(OS);
- reportGlobalToASan(GV, D.getLocation(), OS.str(), D.getType(), IsDynInit);
+
+ bool IsBlacklisted = false;
+ for (auto Attr : D.specific_attrs<NoSanitizeAttr>())
+ if (Attr->getMask() & SanitizerKind::Address)
+ IsBlacklisted = true;
+ reportGlobalToASan(GV, D.getLocation(), OS.str(), D.getType(), IsDynInit,
+ IsBlacklisted);
}
void SanitizerMetadata::disableSanitizerForGlobal(llvm::GlobalVariable *GV) {