mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-23 18:38:30 +08:00
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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user