diff options
author | Albert Cheng <acheng@hdfgroup.org> | 2002-10-15 21:12:48 (GMT) |
---|---|---|
committer | Albert Cheng <acheng@hdfgroup.org> | 2002-10-15 21:12:48 (GMT) |
commit | 7e105d1066908b91f047b46c33e00cec73fa52f6 (patch) | |
tree | f930d59bdbf2e9b76d9bf35779698a9c76dcd80e /src/H5Sselect.c | |
parent | e5565c55a3f467625f3401a7ad0622972e057922 (diff) | |
download | hdf5-7e105d1066908b91f047b46c33e00cec73fa52f6.zip hdf5-7e105d1066908b91f047b46c33e00cec73fa52f6.tar.gz hdf5-7e105d1066908b91f047b46c33e00cec73fa52f6.tar.bz2 |
[svn-r6006] Purpose:
Bug fix (ID 841)
Description:
h5dumptst (generating h5dump test files) failed with an assertion error
in H5S_select_iterate. H5S_select_iterate did not account for scalar
type that has rank=0, thus no dimension sizes.
Solution:
Put the assertion of valid sizes only after verify rank is larger than
0. (fix is coached by Quincey.)
Platforms tested:
Tested h5committest {arabica (fortran), eirene (fortran, C++)
modi4 (parallel, fortran)}? YES.
Misc. update:
Update release_docs/RELEASE for bug fixes, new features, etc. YES.
Diffstat (limited to 'src/H5Sselect.c')
-rw-r--r-- | src/H5Sselect.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/H5Sselect.c b/src/H5Sselect.c index 381e9e0..fca9132 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -406,10 +406,11 @@ H5S_select_iterate(void *buf, hid_t type_id, H5S_t *space, H5D_operator_t op, /* Get the rank of the dataspace */ ndims=space->extent.u.simple.rank; - /* Copy the size of the space */ - assert(space->extent.u.simple.size); - assert(ndims>0); - HDmemcpy(space_size, space->extent.u.simple.size, ndims*sizeof(hsize_t)); + if (ndims > 0){ + /* Copy the size of the space */ + assert(space->extent.u.simple.size); + HDmemcpy(space_size, space->extent.u.simple.size, ndims*sizeof(hsize_t)); + } space_size[ndims]=elmt_size; /* Compute the maximum number of bytes required */ |