[Mesa-stable] [PATCH] clover: Fix the const variant of adaptor_range::end to deal with mismatching range sizes.

Francisco Jerez currojerez at riseup.net
Tue Nov 12 12:36:23 PST 2013


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 at amd.com>
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
Cc: "10.0" <mesa-stable at lists.freedesktop.org>
---
 src/gallium/state_trackers/clover/util/range.hpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/state_trackers/clover/util/range.hpp b/src/gallium/state_trackers/clover/util/range.hpp
index cefa5b5..afa5f77 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
-- 
1.8.3.4



More information about the mesa-stable mailing list