Skip to content

Commit fc352fb

Browse files
committed
Update with the new globs
Created using spr 1.3.6
1 parent 815c4c2 commit fc352fb

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

clang/lib/Basic/SanitizerSpecialCaseList.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ void SanitizerSpecialCaseList::createSanitizerSections() {
5656
bool SanitizerSpecialCaseList::inSection(SanitizerMask Mask, StringRef Prefix,
5757
StringRef Query,
5858
StringRef Category) const {
59-
return inSectionBlame(Mask, Prefix, Query, Category) > 0;
59+
return inSectionBlame(Mask, Prefix, Query, Category);
6060
}
6161

6262
unsigned SanitizerSpecialCaseList::inSectionBlame(SanitizerMask Mask,

llvm/lib/Support/SpecialCaseList.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ Error SpecialCaseList::Matcher::insert(StringRef Pattern, unsigned LineNumber,
6666
}
6767

6868
unsigned SpecialCaseList::Matcher::match(StringRef Query) const {
69-
for (const auto &Glob : Globs)
70-
if (Glob->Pattern.match(Query))
71-
return Glob->LineNo;
72-
for (const auto &[Regex, LineNumber] : RegExes)
73-
if (Regex->match(Query))
74-
return LineNumber;
69+
for (auto it = Globs.crbegin(); it != Globs.crend(); ++it)
70+
if ((*it)->Pattern.match(Query))
71+
return (*it)->LineNo;
72+
for (auto it = RegExes.crbegin(); it != RegExes.crend(); ++it)
73+
if (it->first->match(Query))
74+
return it->second;
7575
return 0;
7676
}
7777

llvm/unittests/Support/SpecialCaseListTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,6 @@ TEST_F(SpecialCaseListTest, Version3) {
326326
EXPECT_EQ(2u, SCL->inSectionBlame("sect1", "src", "fooz"));
327327
EXPECT_EQ(4u, SCL->inSectionBlame("sect1", "src", "barz"));
328328
EXPECT_EQ(5u, SCL->inSectionBlame("sect1", "src", "def"));
329-
EXPECT_EQ(8u, SCL->inSectionBlame("sect2", "src", "def"));
329+
EXPECT_EQ(8u, SCL->inSectionBlame("sect2", "src", "de*"));
330330
}
331331
}

0 commit comments

Comments
 (0)