From 27c4eaac8c066eb1f7c5ad26c6fbc3e78eded778 Mon Sep 17 00:00:00 2001 From: Mark de Wever Date: Sat, 9 Nov 2019 17:01:37 +0100 Subject: [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 --- libcxx/src/regex.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libcxx/src/regex.cpp') 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; } -- cgit v1.2.3