[clang] [UBSan] Implement src:*=sanitize for UBSan (PR #140529)
Thurston Dang via cfe-commits
cfe-commits at lists.llvm.org
Mon May 19 12:07:04 PDT 2025
================
@@ -44,6 +44,13 @@ bool NoSanitizeList::containsFunction(SanitizerMask Mask,
bool NoSanitizeList::containsFile(SanitizerMask Mask, StringRef FileName,
StringRef Category) const {
+ unsigned NoSanLine = SSCL->inSectionBlame(Mask, "src", FileName, Category);
+ unsigned SanLine = SSCL->inSectionBlame(Mask, "src", FileName, "sanitize");
+ // If we have two cases such as `src:a.cpp=sanitize` and `src:a.cpp`, the
+ // current entry override the previous entry.
+ if (NoSanLine > 0 && SanLine > 0) {
----------------
thurstond wrote:
"When writing the body of an if, else, or for/while loop statement, we prefer to omit the braces to avoid unnecessary line noise. However, braces should be used in cases where the omission of braces harm the readability and maintainability of the code. (https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements)
https://github.com/llvm/llvm-project/pull/140529
More information about the cfe-commits
mailing list