summaryrefslogtreecommitdiffstats
path: root/src/H5FL.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2002-11-01 18:39:20 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2002-11-01 18:39:20 (GMT)
commitba751a6a4c23bd0c53625e53f67562f5b4af00b4 (patch)
tree2afd6751bcb6e7eca02611463e16b05e3626287b /src/H5FL.c
parent23457df13df32e1db53b3ce36abd2ef7ad6d0494 (diff)
downloadhdf5-ba751a6a4c23bd0c53625e53f67562f5b4af00b4.zip
hdf5-ba751a6a4c23bd0c53625e53f67562f5b4af00b4.tar.gz
hdf5-ba751a6a4c23bd0c53625e53f67562f5b4af00b4.tar.bz2
[svn-r6047] Purpose:
Bug fix & code cleanup Description: Hyperslab code for collapsing dimensions was incorrectly collapsing selections inappropriately when the fastest changing dimension couldn't be collapsed. Also add some more assertions which will make similar bugs easier to find. Solution: Break out of loop earlier. Platforms tested: modi4 (parallel), too small to triple check.
Diffstat (limited to 'src/H5FL.c')
-rw-r--r--src/H5FL.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/H5FL.c b/src/H5FL.c
index 7e002ad..917821c 100644
--- a/src/H5FL.c
+++ b/src/H5FL.c
@@ -1176,6 +1176,9 @@ H5FL_arr_alloc(H5FL_arr_head_t *head, size_t elem, unsigned clear)
/* Check if there is a maximum number of elements in array */
if(head->maxelem>0) {
+ /* Sanity check that the number of elements is supported */
+ assert((int)elem<=head->maxelem);
+
/* Check for nodes available on the free list first */
if(head->u.list_arr[elem]!=NULL) {
/* Get a pointer to the block on the free list */
@@ -1260,6 +1263,9 @@ H5FL_arr_realloc(H5FL_arr_head_t *head, void * obj, size_t new_elem)
else {
/* Check if there is a maximum number of elements in array */
if(head->maxelem>0) {
+ /* Sanity check that the number of elements is supported */
+ assert((int)new_elem<=head->maxelem);
+
/* Get the pointer to the info header in front of the block to free */
temp=(H5FL_arr_node_t *)((unsigned char *)obj-sizeof(H5FL_arr_node_t));