Add the -fsanitize-blacklist option for the sanitizers. (#2261)

Blacklisting is necessary for some druntime functions, and LLVM/Clang already provides just the right functionality.
This commit is contained in:
Johan Engelen 2017-08-09 23:21:33 +02:00 committed by GitHub
parent 36088a1b49
commit ec9ffe29f1
6 changed files with 104 additions and 1 deletions

View file

@ -954,7 +954,8 @@ void DtoDefineFunction(FuncDeclaration *fd, bool linkageAvailableExternally) {
if (gABI->needsUnwindTables()) {
func->addFnAttr(LLAttribute::UWTable);
}
if (opts::isAnySanitizerEnabled()) {
if (opts::isAnySanitizerEnabled() &&
!opts::functionIsInSanitizerBlacklist(fd)) {
// Set the required sanitizer attribute.
if (opts::isSanitizerEnabled(opts::AddressSanitizer)) {
func->addFnAttr(LLAttribute::SanitizeAddress);