diff options
author | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2018-12-15 01:06:25 (GMT) |
---|---|---|
committer | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2018-12-15 01:06:25 (GMT) |
commit | 22bc8ba7bfb2c82b6cea6b5f5d1da2f2119c348b (patch) | |
tree | a15437bcf06df4a5c30b924fbcd7be135c992037 /src/H5FA.c | |
parent | 1cffc3ff0f3454fedf6edcdb93dcde5ed1b910d6 (diff) | |
download | hdf5-22bc8ba7bfb2c82b6cea6b5f5d1da2f2119c348b.zip hdf5-22bc8ba7bfb2c82b6cea6b5f5d1da2f2119c348b.tar.gz hdf5-22bc8ba7bfb2c82b6cea6b5f5d1da2f2119c348b.tar.bz2 |
Addressed HDFFV-10661
Description:
- Fixed a bug triggered by tests in chunk_info.c. The returned value
from a callback function was not checked in H5EA_iterate(), H5FA_iterate(),
and H5D__none_idx_iterate(). This oversight caused a callback function
to continue iterating even though it's supposed to stop. Vailin confirmed.
- Addressed review comments and made various improvements on the tests.
Platforms tested:
Linux/64 (jelly)
Linux/64 (platypus)
Darwin (osx1010test)
Diffstat (limited to 'src/H5FA.c')
-rw-r--r-- | src/H5FA.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -699,6 +699,7 @@ H5FA_iterate(H5FA_t *fa, H5FA_operator_t op, void *udata)) /* Local variables */ uint8_t *elmt = NULL; hsize_t u; + int ret_value = H5_ITER_CONT; /* Return value from callback */ /* * Check arguments. @@ -712,17 +713,15 @@ H5FA_iterate(H5FA_t *fa, H5FA_operator_t op, void *udata)) H5E_THROW(H5E_CANTALLOC, "memory allocation failed for fixed array element") /* Iterate over all elements in array */ - for(u = 0; u < fa->hdr->stats.nelmts; u++) { - int cb_ret; /* Return value from callback */ - + for(u = 0; u < fa->hdr->stats.nelmts && ret_value == H5_ITER_CONT; u++) { /* Get array element */ if(H5FA_get(fa, u, elmt) < 0) H5E_THROW(H5E_CANTGET, "unable to delete fixed array") /* Make callback */ - if((cb_ret = (*op)(u, elmt, udata)) < 0) { + if((ret_value = (*op)(u, elmt, udata)) < 0) { H5E_PRINTF(H5E_BADITER, "iterator function failed"); - H5_LEAVE(cb_ret) + H5_LEAVE(ret_value) } /* end if */ } /* end for */ |