clover: Fix the const variant of adaptor_range::end to deal with mismatching range sizes.

Fixes infinite loop in find_grid_optimal_factor() in cases where the
user specifies a grid size with less dimensions than the device
supports.

Reported-by: Tom Stellard <thomas.stellard@amd.com>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 99d447cc5d)
This commit is contained in:
Francisco Jerez 2013-11-12 11:14:20 -08:00 committed by Ian Romanick
parent c4cc166abc
commit c702f5eead

View file

@ -269,7 +269,8 @@ namespace clover {
typename super::const_iterator
end() const {
return { f, tuple::map(ends(), os) };
return { f, tuple::map(advances_by(size()),
tuple::map(begins(), os)) };
}
typename super::size_type