aboutsummaryrefslogtreecommitdiffstats
path: root/include/regex
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2016-02-21 13:53:59 +0000
committerDimitry Andric <dim@FreeBSD.org>2016-02-21 13:53:59 +0000
commitbb5e33f003797b67974a8893f7f2930fc51b8210 (patch)
tree2ef96e4c81fca716906b41bbaef5978394533a07 /include/regex
parent09a81ed06676bfa727cafe139f24ab2c076ecd04 (diff)
downloadsrc-bb5e33f003797b67974a8893f7f2930fc51b8210.tar.gz
src-bb5e33f003797b67974a8893f7f2930fc51b8210.zip
Notes
Notes: svn path=/vendor/libc++/dist/; revision=295852 svn path=/vendor/libc++/libc++-release_380-r262564/; revision=296363; tag=vendor/libc++/libc++-release_380-r262564
Diffstat (limited to 'include/regex')
-rw-r--r--include/regex16
1 files changed, 12 insertions, 4 deletions
diff --git a/include/regex b/include/regex
index b9dac4765cdf..1139d8fb2a90 100644
--- a/include/regex
+++ b/include/regex
@@ -976,7 +976,12 @@ public:
typedef locale locale_type;
typedef ctype_base::mask char_class_type;
+#if defined(__mips__) && defined(__GLIBC__)
+ static const char_class_type __regex_word = static_cast<char_class_type>(_ISbit(15));
+#else
static const char_class_type __regex_word = 0x80;
+#endif
+
private:
locale __loc_;
const ctype<char_type>* __ct_;
@@ -4265,6 +4270,9 @@ basic_regex<_CharT, _Traits>::__parse_atom_escape(_ForwardIterator __first,
if (__first != __last && *__first == '\\')
{
_ForwardIterator __t1 = _VSTD::next(__first);
+ if (__t1 == __last)
+ __throw_regex_error<regex_constants::error_escape>();
+
_ForwardIterator __t2 = __parse_decimal_escape(__t1, __last);
if (__t2 != __t1)
__first = __t2;
@@ -5384,8 +5392,8 @@ match_results<_BidirectionalIterator, _Allocator>::format(_OutputIter __out,
if ('0' <= *__fmt_first && *__fmt_first <= '9')
{
size_t __i = *__fmt_first - '0';
- __out = _VSTD::copy(__matches_[__i].first,
- __matches_[__i].second, __out);
+ __out = _VSTD::copy((*this)[__i].first,
+ (*this)[__i].second, __out);
}
else
{
@@ -5436,8 +5444,8 @@ match_results<_BidirectionalIterator, _Allocator>::format(_OutputIter __out,
++__fmt_first;
__i = 10 * __i + *__fmt_first - '0';
}
- __out = _VSTD::copy(__matches_[__i].first,
- __matches_[__i].second, __out);
+ __out = _VSTD::copy((*this)[__i].first,
+ (*this)[__i].second, __out);
}
else
{