| Index: compiled/filter/RegExpFilter.cpp |
| =================================================================== |
| --- a/compiled/filter/RegExpFilter.cpp |
| +++ b/compiled/filter/RegExpFilter.cpp |
| @@ -305,22 +305,24 @@ Filter::Type RegExpFilter::Parse(Depende |
| data.mPatternEnd = text.find(u'$', data.mPatternStart); |
| if (data.mPatternEnd == text.npos) |
| data.mPatternEnd = text.length(); |
| ParseOptions(text, error, data, data.mPatternEnd + 1); |
| if (!error.empty()) |
| return Type::INVALID; |
| + data.mRegexpId = -1; |
| if (data.mPatternEnd - data.mPatternStart >= 2 && |
| text[data.mPatternStart] == u'/' && |
| text[data.mPatternEnd - 1] == u'/') |
| { |
| - data.SetRegExp(GenerateRegExp(DependentString(text, data.mPatternStart + 1, |
| - data.mPatternEnd - data.mPatternStart - 2), data.mMatchCase)); |
| + data.mRegexpId = GenerateRegExp(DependentString(text, |
| + data.mPatternStart + 1, data.mPatternEnd - data.mPatternStart - 2), |
| + data.mMatchCase); |
| if (data.mRegexpId == -1) |
| { |
| error.reset(u"filter_invalid_regexp"_str); |
| return Type::INVALID; |
| } |
| } |
| return type; |
| @@ -386,12 +388,12 @@ bool RegExpFilter::Matches(const String& |
| !IsActiveOnDomain(docDomain, sitekey)) |
| { |
| return false; |
| } |
| if (!mData.RegExpParsingDone()) |
| { |
| const OwnedString pattern(mData.GetRegExpSource(mText)); |
|
sergei
2017/10/18 10:58:42
BTW, `pattern` should be a DependentString there i
|
| - mData.SetRegExp(GenerateRegExp(RegExpFromSource(pattern), mData.mMatchCase)); |
| + mData.mRegexpId = GenerateRegExp(RegExpFromSource(pattern), mData.mMatchCase); |
| } |
| return TestRegExp(mData.mRegexpId, location); |
| } |