mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-24 03:32:35 +08:00
Fix PR#26175. Thanks to Josh Petrie for the report and the patch. Reviewed as http://reviews.llvm.org/D16262
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@258107 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -4265,6 +4265,9 @@ basic_regex<_CharT, _Traits>::__parse_atom_escape(_ForwardIterator __first,
|
|||||||
if (__first != __last && *__first == '\\')
|
if (__first != __last && *__first == '\\')
|
||||||
{
|
{
|
||||||
_ForwardIterator __t1 = _VSTD::next(__first);
|
_ForwardIterator __t1 = _VSTD::next(__first);
|
||||||
|
if (__t1 == __last)
|
||||||
|
__throw_regex_error<regex_constants::error_escape>();
|
||||||
|
|
||||||
_ForwardIterator __t2 = __parse_decimal_escape(__t1, __last);
|
_ForwardIterator __t2 = __parse_decimal_escape(__t1, __last);
|
||||||
if (__t2 != __t1)
|
if (__t2 != __t1)
|
||||||
__first = __t2;
|
__first = __t2;
|
||||||
|
@@ -33,6 +33,7 @@ int main()
|
|||||||
{
|
{
|
||||||
assert(error_escape_thrown("[\\a]"));
|
assert(error_escape_thrown("[\\a]"));
|
||||||
assert(error_escape_thrown("\\a"));
|
assert(error_escape_thrown("\\a"));
|
||||||
|
assert(error_escape_thrown("\\"));
|
||||||
|
|
||||||
assert(error_escape_thrown("[\\e]"));
|
assert(error_escape_thrown("[\\e]"));
|
||||||
assert(error_escape_thrown("\\e"));
|
assert(error_escape_thrown("\\e"));
|
||||||
|
Reference in New Issue
Block a user