mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-03-05 00:48:08 +00:00
Fix Bug 19678 - libc++ does not correctly handle the regex: '[^\0]*'
llvm-svn: 209307
This commit is contained in:
parent
4aa7340d14
commit
9393b5113b
@ -4541,6 +4541,13 @@ basic_regex<_CharT, _Traits>::__parse_character_escape(_ForwardIterator __first,
|
||||
__push_char(_CharT(__sum));
|
||||
++__first;
|
||||
break;
|
||||
case '0':
|
||||
if (__str)
|
||||
*__str = _CharT(0);
|
||||
else
|
||||
__push_char(_CharT(0));
|
||||
++__first;
|
||||
break;
|
||||
default:
|
||||
if (*__first != '_' && !__traits_.isctype(*__first, ctype_base::alnum))
|
||||
{
|
||||
|
@ -608,6 +608,18 @@ int main()
|
||||
assert(m.position(0) == 0);
|
||||
assert(m.str(0) == s);
|
||||
}
|
||||
{
|
||||
std::cmatch m;
|
||||
const char s[] = "foobar";
|
||||
assert(std::regex_match(s, m, std::regex("[^\\0]*")));
|
||||
assert(m.size() == 1);
|
||||
}
|
||||
{
|
||||
std::cmatch m;
|
||||
const char s[] = "foo\0bar";
|
||||
assert(std::regex_match(s, s+7, m, std::regex("[abfor\\0]*")));
|
||||
assert(m.size() == 1);
|
||||
}
|
||||
std::locale::global(std::locale("C"));
|
||||
{
|
||||
std::cmatch m;
|
||||
|
Loading…
x
Reference in New Issue
Block a user