Fix PR 19663. Some calls to find(vector<bool>) were returning iterators that were subtly invalid (didn't compare equal). Thanks to Erik Verbruggen for the report (and diagnosis)

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@208096 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Marshall Clow
2014-05-06 15:33:23 +00:00
parent 55622073f4
commit 6b5be703db
2 changed files with 4 additions and 2 deletions

View File

@@ -174,7 +174,7 @@ __find_bool_true(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type
if (__b)
return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__ctz(__b)));
if (__n == __dn)
return _It(__first.__seg_, __first.__ctz_ + __n);
return __first + __n;
__n -= __dn;
++__first.__seg_;
}
@@ -210,7 +210,7 @@ __find_bool_false(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type
if (__b)
return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__ctz(__b)));
if (__n == __dn)
return _It(__first.__seg_, __first.__ctz_ + __n);
return __first + __n;
__n -= __dn;
++__first.__seg_;
}