From: Francisco Jerez Date: Tue, 12 Nov 2013 19:14:20 +0000 (-0800) Subject: clover: Fix the const variant of adaptor_range::end to deal with mismatching range... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=99d447cc5dafa3a36b970068961989cced62e3b6;p=mesa.git 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 Cc: "10.0" --- diff --git a/src/gallium/state_trackers/clover/util/range.hpp b/src/gallium/state_trackers/clover/util/range.hpp index cefa5b5ad17..afa5f7730bf 100644 --- a/src/gallium/state_trackers/clover/util/range.hpp +++ b/src/gallium/state_trackers/clover/util/range.hpp @@ -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