[lld] Initialize SingleStringMatcher::ExactMatch (#123138)
It was not set false in all branches.
This commit is contained in:
@@ -19,10 +19,14 @@
|
||||
using namespace llvm;
|
||||
using namespace lld;
|
||||
|
||||
SingleStringMatcher::SingleStringMatcher(StringRef Pattern) {
|
||||
if (Pattern.size() > 2 && Pattern.starts_with("\"") &&
|
||||
Pattern.ends_with("\"")) {
|
||||
ExactMatch = true;
|
||||
static bool isExact(StringRef Pattern) {
|
||||
return Pattern.size() > 2 && Pattern.starts_with("\"") &&
|
||||
Pattern.ends_with("\"");
|
||||
}
|
||||
|
||||
SingleStringMatcher::SingleStringMatcher(StringRef Pattern)
|
||||
: ExactMatch(isExact(Pattern)) {
|
||||
if (ExactMatch) {
|
||||
ExactPattern = Pattern.substr(1, Pattern.size() - 2);
|
||||
} else {
|
||||
Expected<GlobPattern> Glob = GlobPattern::create(Pattern);
|
||||
@@ -30,7 +34,6 @@ SingleStringMatcher::SingleStringMatcher(StringRef Pattern) {
|
||||
error(toString(Glob.takeError()) + ": " + Pattern);
|
||||
return;
|
||||
}
|
||||
ExactMatch = false;
|
||||
GlobPatternMatcher = *Glob;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user