Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions clang/lib/AST/ASTContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -875,8 +875,7 @@ ASTContext::insertCanonicalTemplateTemplateParmDeclInternal(
bool ASTContext::isTypeIgnoredBySanitizer(const SanitizerMask &Mask,
const QualType &Ty) const {
std::string TyName = Ty.getUnqualifiedType().getAsString(getPrintingPolicy());
return NoSanitizeL->containsType(Mask, TyName) &&
!NoSanitizeL->containsType(Mask, TyName, "sanitize");
return NoSanitizeL->containsType(Mask, TyName);
}

TargetCXXABI::Kind ASTContext::getCXXABIKind() const {
Expand Down
6 changes: 5 additions & 1 deletion clang/lib/Basic/NoSanitizeList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ bool NoSanitizeList::containsGlobal(SanitizerMask Mask, StringRef GlobalName,

bool NoSanitizeList::containsType(SanitizerMask Mask, StringRef MangledTypeName,
StringRef Category) const {
return SSCL->inSection(Mask, "type", MangledTypeName, Category);
auto NoSan = SSCL->inSectionBlame(Mask, "type", FileName, Category);
if (NoSan == llvm::SpecialCaseList::NotFound)
return false;
auto San = SSCL->inSectionBlame(Mask, "type", FileName, "sanitize");
return San == llvm::SpecialCaseList::NotFound || NoSan > San;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR looks good to me. Only quirk is NoSan > San. The autos slightly obscure the fact these are pair types. Thankfully, the FileIdx portion of the pair is properly mapped left-to-right alongside all the -fsanitize-ignorelist= arguments within SpecialCaseList::createInternal. This means we'll get the obvious behavior of most recent SCL file which is then further delineated by line number.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review. Given this part is going to be refactored in #142027 , I am going to merge this PR and change "auto" to "std::pair<unsigned, unsigned>" in #142027

}

bool NoSanitizeList::containsFunction(SanitizerMask Mask,
Expand Down
Loading