summaryrefslogtreecommitdiffstats
path: root/libcxx/include/regex
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/include/regex')
-rw-r--r--libcxx/include/regex3
1 files changed, 2 insertions, 1 deletions
diff --git a/libcxx/include/regex b/libcxx/include/regex
index 1c4cc1d9abb..5a6c7fbb8e0 100644
--- a/libcxx/include/regex
+++ b/libcxx/include/regex
@@ -4314,7 +4314,8 @@ basic_regex<_CharT, _Traits>::__parse_decimal_escape(_ForwardIterator __first,
else if ('1' <= *__first && *__first <= '9')
{
unsigned __v = *__first - '0';
- for (++__first; '0' <= *__first && *__first <= '9'; ++__first)
+ for (++__first;
+ __first != __last && '0' <= *__first && *__first <= '9'; ++__first)
__v = 10 * __v + *__first - '0';
if (__v > mark_count())
__throw_regex_error<regex_constants::error_backref>();
OpenPOWER on IntegriCloud