summaryrefslogtreecommitdiffstats
path: root/src/H5Shyper.c
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2015-03-24 23:23:18 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2015-03-24 23:23:18 (GMT)
commit1583b1b729c0b097fdc0b6510b867cedd4a2e883 (patch)
tree10a63a0ba192a5bf72dd14aa233d3231157381d2 /src/H5Shyper.c
parentb8551d25ccecf49e3541b0087b8649f0ef572b54 (diff)
downloadhdf5-1583b1b729c0b097fdc0b6510b867cedd4a2e883.zip
hdf5-1583b1b729c0b097fdc0b6510b867cedd4a2e883.tar.gz
hdf5-1583b1b729c0b097fdc0b6510b867cedd4a2e883.tar.bz2
[svn-r26566] Fix error in H5S__hyper_project_intersection algorithm.
Note there are still some code coverage assertions in the selection matching algorithm - if you hit these try taking them out. Note make check still fails in h5dump test (unrelated to this checkin). Tested: ummon
Diffstat (limited to 'src/H5Shyper.c')
-rw-r--r--src/H5Shyper.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/H5Shyper.c b/src/H5Shyper.c
index 51460da..f866e5d 100644
--- a/src/H5Shyper.c
+++ b/src/H5Shyper.c
@@ -9077,8 +9077,8 @@ H5S__hyper_project_intersection(const H5S_t *src_space, const H5S_t *dst_space,
} /* end if */
else {
/* Sequences intersect, add intersection to projected space */
- /* Calculate intersection sequence and advance any sequences we
- * complete */
+ /* Calculate intersection sequence in terms of offset within
+ * source selection and advance any sequences we complete */
if(ss_off[ss_i] >= sis_off[sis_i])
int_sel_off = ss_sel_off;
else
@@ -9094,7 +9094,7 @@ H5S__hyper_project_intersection(const H5S_t *src_space, const H5S_t *dst_space,
+ (hsize_t)sis_len[sis_i]))
advance_sis = TRUE;
- /* Project to destination */
+ /* Project intersection sequence to destination selection */
while(int_len > (size_t)0) {
while(ds_sel_off + (hsize_t)ds_len[ds_i] <= int_sel_off) {
/* Intersection is not projected to this destination
@@ -9133,7 +9133,8 @@ H5S__hyper_project_intersection(const H5S_t *src_space, const H5S_t *dst_space,
* ouside the plane of the span currently being built
* (i.e. it's finished being built) */
for(i = proj_rank - 1; ((i > 0)
- && ((proj_off / proj_down_dims[i])
+ && (((proj_off / proj_down_dims[i])
+ % proj_space->extent.size[i])
!= curr_span_dim[i - 1])); i--) {
if(curr_span_tree[i]) {
HDassert(prev_span[i]);
@@ -9153,11 +9154,11 @@ H5S__hyper_project_intersection(const H5S_t *src_space, const H5S_t *dst_space,
} /* end if */
/* Update curr_span_dim */
- curr_span_dim[i - 1] = proj_off / proj_down_dims[i];
+ curr_span_dim[i - 1] = (proj_off / proj_down_dims[i]) % proj_space->extent.size[i];
} /* end for */
/* Compute bounds for new span in lowest dimension */
- low = proj_off % proj_down_dims[proj_rank - 1];
+ low = proj_off % proj_space->extent.size[proj_rank - 1];
span_len = MIN(proj_len_rem,
(size_t)(proj_space->extent.size[proj_rank - 1]
- low));