summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2014-10-19 20:22:58 (GMT)
committerTobias Markmann <tm@ayena.de>2014-10-20 13:49:33 (GMT)
commit6b22dfcf59474dd016a0355a3102a1dd3692d92c (patch)
tree2b1fd33be433a91e81fee84fdc2bf1b52575d934 /3rdParty/Boost/src/boost/regex/v4/perl_matcher_non_recursive.hpp
parent38b0cb785fea8eae5e48fae56440695fdfd10ee1 (diff)
downloadswift-6b22dfcf59474dd016a0355a3102a1dd3692d92c.zip
swift-6b22dfcf59474dd016a0355a3102a1dd3692d92c.tar.bz2
Update Boost in 3rdParty to version 1.56.0.
This updates Boost in our 3rdParty directory to version 1.56.0. Updated our update.sh script to stop on error. Changed error reporting in SwiftTools/CrashReporter.cpp to SWIFT_LOG due to missing include of <iostream> with newer Boost. Change-Id: I4b35c77de951333979a524097f35f5f83d325edc
Diffstat (limited to '3rdParty/Boost/src/boost/regex/v4/perl_matcher_non_recursive.hpp')
-rw-r--r--3rdParty/Boost/src/boost/regex/v4/perl_matcher_non_recursive.hpp27
1 files changed, 24 insertions, 3 deletions
diff --git a/3rdParty/Boost/src/boost/regex/v4/perl_matcher_non_recursive.hpp b/3rdParty/Boost/src/boost/regex/v4/perl_matcher_non_recursive.hpp
index 0da43e3..5c1f7a9 100644
--- a/3rdParty/Boost/src/boost/regex/v4/perl_matcher_non_recursive.hpp
+++ b/3rdParty/Boost/src/boost/regex/v4/perl_matcher_non_recursive.hpp
@@ -703,7 +703,13 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_char_repeat()
if(::boost::is_random_access_iterator<BidiIterator>::value)
{
BidiIterator end = position;
- std::advance(end, (std::min)((std::size_t)::boost::re_detail::distance(position, last), desired));
+ // Move end forward by "desired", preferably without using distance or advance if we can
+ // as these can be slow for some iterator types.
+ std::size_t len = (desired == (std::numeric_limits<std::size_t>::max)()) ? 0u : ::boost::re_detail::distance(position, last);
+ if(desired >= len)
+ end = last;
+ else
+ std::advance(end, desired);
BidiIterator origin(position);
while((position != end) && (traits_inst.translate(*position, icase) == what))
{
@@ -771,7 +777,13 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_set_repeat()
if(::boost::is_random_access_iterator<BidiIterator>::value)
{
BidiIterator end = position;
- std::advance(end, (std::min)((std::size_t)::boost::re_detail::distance(position, last), desired));
+ // Move end forward by "desired", preferably without using distance or advance if we can
+ // as these can be slow for some iterator types.
+ std::size_t len = (desired == (std::numeric_limits<std::size_t>::max)()) ? 0u : ::boost::re_detail::distance(position, last);
+ if(desired >= len)
+ end = last;
+ else
+ std::advance(end, desired);
BidiIterator origin(position);
while((position != end) && map[static_cast<unsigned char>(traits_inst.translate(*position, icase))])
{
@@ -840,7 +852,13 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_long_set_repeat()
if(::boost::is_random_access_iterator<BidiIterator>::value)
{
BidiIterator end = position;
- std::advance(end, (std::min)((std::size_t)::boost::re_detail::distance(position, last), desired));
+ // Move end forward by "desired", preferably without using distance or advance if we can
+ // as these can be slow for some iterator types.
+ std::size_t len = (desired == (std::numeric_limits<std::size_t>::max)()) ? 0u : ::boost::re_detail::distance(position, last);
+ if(desired >= len)
+ end = last;
+ else
+ std::advance(end, desired);
BidiIterator origin(position);
while((position != end) && (position != re_is_set_member(position, last, set, re.get_data(), icase)))
{
@@ -1268,6 +1286,9 @@ bool perl_matcher<BidiIterator, Allocator, traits>::unwind_fast_dot_repeat(bool
}while((count < rep->max) && (position != last) && !can_start(*position, rep->_map, mask_skip));
}
+ // remember where we got to if this is a leading repeat:
+ if((rep->leading) && (count < rep->max))
+ restart = position;
if(position == last)
{
// can't repeat any more, remove the pushed state: