diff options
author | Mark de Wever <koraq@xs4all.nl> | 2019-11-09 17:01:37 +0100 |
---|---|---|
committer | Mark de Wever <koraq@xs4all.nl> | 2019-11-09 17:01:37 +0100 |
commit | 27c4eaac8c066eb1f7c5ad26c6fbc3e78eded778 (patch) | |
tree | a40c947357bdf9ffb6fb8a97af4cb2fa6c8b4716 /libcxx/src/regex.cpp | |
parent | b9be5ce8f3e0e697a61ad16e2c669de6ea8f8739 (diff) | |
download | bcm5719-llvm-27c4eaac8c066eb1f7c5ad26c6fbc3e78eded778.tar.gz bcm5719-llvm-27c4eaac8c066eb1f7c5ad26c6fbc3e78eded778.zip |
[libc++] Validate the entire regex is consumed
This change would have warned about the bug found in D62451.
No unit tests since the exception should never throw.
Differential Revision: https://reviews.llvm.org/D62452
Diffstat (limited to 'libcxx/src/regex.cpp')
-rw-r--r-- | libcxx/src/regex.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libcxx/src/regex.cpp b/libcxx/src/regex.cpp index a971f646459..d31e4948743 100644 --- a/libcxx/src/regex.cpp +++ b/libcxx/src/regex.cpp @@ -53,6 +53,8 @@ make_error_type_string(regex_constants::error_type ecode) return "An invalid regex grammar has been requested."; case regex_constants::__re_err_empty: return "An empty regex is not allowed in the POSIX grammar."; + case regex_constants::__re_err_parse: + return "The parser did not consume the entire regular expression."; default: break; } |