Detect and throw on a class of bad regexes that we mistakenly accepted before. Thanks to Trevor Smigiel for the report

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@243030 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Marshall Clow
2015-07-23 18:27:51 +00:00
parent 3a59ae6783
commit 568bd0222f
3 changed files with 51 additions and 1 deletions

View File

@@ -22,7 +22,7 @@ static bool error_escape_thrown(const char *pat)
bool result = false;
try {
std::regex re(pat);
} catch (std::regex_error &ex) {
} catch (const std::regex_error &ex) {
result = (ex.code() == std::regex_constants::error_escape);
}
return result;