summaryrefslogtreecommitdiffstats
path: root/src/H5B2.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5B2.c')
-rw-r--r--src/H5B2.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/H5B2.c b/src/H5B2.c
index 75ee99e..7e3dd47 100644
--- a/src/H5B2.c
+++ b/src/H5B2.c
@@ -743,7 +743,8 @@ H5B2_remove(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_remove_t op,
if(H5FL_fac_term(hdr->node_info[hdr->depth].node_ptr_fac) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't destroy node's node pointer block factory")
- hdr->depth -= (uint16_t)depth_decreased;
+ HDassert((uint16_t)(hdr->depth - depth_decreased) < hdr->depth);
+ hdr->depth = (uint16_t)(hdr->depth - depth_decreased);
} /* end for */
} /* end if */
else {
@@ -824,7 +825,8 @@ H5B2_remove_by_idx(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order,
if(H5FL_fac_term(hdr->node_info[hdr->depth].node_ptr_fac) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't destroy node's node pointer block factory")
- hdr->depth -= (uint16_t)depth_decreased;
+ HDassert((uint16_t)(hdr->depth - depth_decreased) < hdr->depth);
+ hdr->depth = (uint16_t)(hdr->depth - depth_decreased);
} /* end for */
} /* end if */
else {