[PATCH] D37925: Allow specifying sanitizers in blacklists
Vlad Tsyrklevich via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 15 19:13:05 PDT 2017
vlad.tsyrklevich added inline comments.
================
Comment at: include/clang/Basic/SanitizerSpecialCaseList.h:33
+
+ bool inSection(SanitizerMask Mask, StringRef Prefix, StringRef Query,
+ StringRef Category = StringRef()) const;
----------------
eugenis wrote:
> Please add a comment on the meaning of Mask. I assume it's any-of?
Correct, I'll add a comment regarding this.
================
Comment at: lib/CodeGen/CGDeclCXX.cpp:322
+ if (getLangOpts().Sanitize.hasOneOf(ASanMask))
+ if (!isInSanitizerBlacklist(ASanMask, Fn, Loc))
Fn->addFnAttr(llvm::Attribute::SanitizeAddress);
----------------
This use of ASanMask could also confound address & kernel-address as @eugenis pointed out.
================
Comment at: lib/CodeGen/CodeGenModule.cpp:1569
const auto &SanitizerBL = getContext().getSanitizerBlacklist();
- if (SanitizerBL.isBlacklistedGlobal(GV->getName(), Category))
+ if (SanitizerBL.isBlacklistedGlobal(ASanMask, GV->getName(), Category))
return true;
----------------
eugenis wrote:
> would this blacklist [address] when compiling for kernel-address, and vice versa?
Yes, it would. We should pass the actual sanitizer option mask ANDed with the ASanMask here. Thanks!
https://reviews.llvm.org/D37925
More information about the cfe-commits
mailing list