Skip to content

Commit 9b01522

Browse files
committed
fix prefix regex validation
"prefix must start with a letter and contain only alphanumeric characters, hyphens, and underscores" but current regex didn't enforced that rule, fix this.
1 parent ca4a405 commit 9b01522

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/FileCheck/FileCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2474,7 +2474,7 @@ static bool ValidatePrefixes(StringRef Kind, StringSet<> &UniquePrefixes,
24742474
<< "string\n";
24752475
return false;
24762476
}
2477-
static const Regex Validator("^[a-zA-Z0-9_-]*$");
2477+
static const Regex Validator("^[a-zA-Z][a-zA-Z0-9_-]*$");
24782478
if (!Validator.match(Prefix)) {
24792479
errs() << "error: supplied " << Kind << " prefix must start with a "
24802480
<< "letter and contain only alphanumeric characters, hyphens, and "

0 commit comments

Comments
 (0)