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

Devon Loehr via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 8 09:08:07 PDT 2025


================
@@ -231,6 +233,10 @@ bool GlobPattern::SubGlobPattern::match(StringRef Str) const {
         ++S;
         continue;
       }
+    } else if (IsSlashAgnostic && *P == '/' && (*S == '/' || *S == '\\')) {
----------------
DKLoehr wrote:

I don't think we should match both ways, because backslashes in patterns already have a meaning ("exactly the following character"). If we escaped the backslash, then we should expect to match exactly a backslash. It's not clear how to also match '/' in that case and still be clear on the rules.

Letting '/' match both seems good to me because it allows us to use forward slash as a generic "path separator" marker, and that's all we need here.

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


More information about the llvm-commits mailing list