[clang] Implement src:*=sanitize for UBSan (PR #139772)
Qinkun Bao via cfe-commits
cfe-commits at lists.llvm.org
Thu May 15 08:35:44 PDT 2025
================
@@ -0,0 +1,23 @@
+// RUN: rm -rf %t
+// RUN: split-file %s %t
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -fsanitize=signed-integer-overflow -fsanitize-ignorelist=%t/src.ignorelist -emit-llvm %t/test1.c -o - | FileCheck %s -check-prefix=CHECK-ALLOWLIST
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -fsanitize=signed-integer-overflow -fsanitize-ignorelist=%t/src.ignorelist -emit-llvm %t/test2.c -o - | FileCheck %s -check-prefix=CHECK-IGNORELIST
+
+
+// Verify ubsan only emits checks for files in the allowlist
+
+//--- src.ignorelist
+src:*
----------------
qinkunbao wrote:
> But, SpecialCaseList::Sections for whatever reasons is StringMap,
> so it's ordered by name, and it's not used anyway.
Oh, I find the `key` of the StringMap `Sections` is actually used. Here is the [Link](https://github.com/llvm/llvm-project/blob/main/clang/lib/Basic/Diagnostic.cpp#L542). How about creating a vector<Section*> to track the order?
https://github.com/llvm/llvm-project/pull/139772
More information about the cfe-commits
mailing list