Added range checking to the view creation code.

[SVN r32928]
This commit is contained in:
Ronald Garcia
2006-02-14 19:26:11 +00:00
parent fc92cffda8
commit e977bb77b5

View File

@@ -439,6 +439,12 @@ protected:
index index_factor = current_range.stride();
index len = (finish - start + (index_factor - 1)) / index_factor;
BOOST_ASSERT(index_bases[n] <= start &&
start < index_bases[n]+index(extents[n]));
BOOST_ASSERT(index_bases[n] <= finish &&
finish <= index_bases[n]+index(extents[n]));
BOOST_ASSERT(index_factor > 0);
// the array data pointer is modified to account for non-zero
// bases during slicing (see [Garcia] for the math involved)
offset += start * strides[n];