[clang] [llvm] Make sanitizer special case list slash-agnostic (PR #149886)

James Y Knight via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 5 09:29:53 PDT 2025


================
@@ -59,7 +59,8 @@ Error SpecialCaseList::Matcher::insert(StringRef Pattern, unsigned LineNumber,
   Glob->LineNo = LineNumber;
   // We must be sure to use the string in `Glob` rather than the provided
   // reference which could be destroyed before match() is called
-  if (auto Err = GlobPattern::create(Glob->Name, /*MaxSubPatterns=*/1024)
+  if (auto Err = GlobPattern::create(Glob->Name, /*MaxSubPatterns=*/1024,
+                                     /*IsSlashAgnostic=*/true)
----------------
jyknight wrote:

A filename with an actual backslash in it is valid on Unix, and would be incorrectly matched. (Of course, the likelihood of someone using a source file with such an odd filename is low.)

https://github.com/llvm/llvm-project/pull/149886


More information about the llvm-commits mailing list