summaryrefslogtreecommitdiffstats
path: root/libcxx/include/algorithm
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2011-12-29 17:45:35 +0000
committerHoward Hinnant <hhinnant@apple.com>2011-12-29 17:45:35 +0000
commitb34b48196ca5de5f83562ee9dd0050350b8e4e16 (patch)
treed753ceb92d1748ca2ded9620ba621b0a94b5110e /libcxx/include/algorithm
parent9e61291bf56234402e0bae5caa68adbfbc1814e5 (diff)
downloadbcm5719-llvm-b34b48196ca5de5f83562ee9dd0050350b8e4e16.tar.gz
bcm5719-llvm-b34b48196ca5de5f83562ee9dd0050350b8e4e16.zip
The exception recovery mechanism for the uninitialized_* algorithms did not work for iterators into discontiguous memory.
llvm-svn: 147343
Diffstat (limited to 'libcxx/include/algorithm')
-rw-r--r--libcxx/include/algorithm2
1 files changed, 2 insertions, 0 deletions
diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm
index 4679845e132..f9c6843a60a 100644
--- a/libcxx/include/algorithm
+++ b/libcxx/include/algorithm
@@ -4751,6 +4751,8 @@ __nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _Rando
while (true)
{
__restart:
+ if (__nth == __last)
+ return;
difference_type __len = __last - __first;
switch (__len)
{
OpenPOWER on IntegriCloud