Fix recursive expressions where the recursion appears more than once.

Fixes https://github.com/boostorg/regex/issues/87.
Also fix some more msvc warnings.
This commit is contained in:
jzmaddock
2020-01-23 19:24:33 +00:00
parent bc160a58f0
commit afc4229234
5 changed files with 18 additions and 5 deletions

View File

@ -157,7 +157,7 @@ c_regex_traits<char>::char_class_type BOOST_REGEX_CALL c_regex_traits<char>::loo
s[i] = static_cast<char>((std::tolower)(static_cast<unsigned char>(s[i])));
idx = ::boost::BOOST_REGEX_DETAIL_NS::get_default_class_id(&*s.begin(), &*s.begin() + s.size());
}
BOOST_ASSERT(std::size_t(idx+1) < sizeof(masks) / sizeof(masks[0]));
BOOST_ASSERT(std::size_t(idx) + 1u < sizeof(masks) / sizeof(masks[0]));
return masks[idx+1];
}