From 7e105d1066908b91f047b46c33e00cec73fa52f6 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Tue, 15 Oct 2002 16:12:48 -0500 Subject: [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. --- src/H5Sselect.c | 9 +++++---- 1 file 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 */ -- cgit v0.12