summaryrefslogtreecommitdiffstats
path: root/src/H5B2cache.c
diff options
context:
space:
mode:
authorkmu <kmu@hdfgroup.org>2019-12-11 16:44:56 (GMT)
committerkmu <kmu@hdfgroup.org>2019-12-11 16:44:56 (GMT)
commit45a62b2d46523c15a7d2bc7f52db2b756b40df26 (patch)
tree9be754803238d1c98cde34ca9d23b3b6e3e7651b /src/H5B2cache.c
parenta00d71b2e26c06a299ac92552b7887ca017fd4d3 (diff)
downloadhdf5-45a62b2d46523c15a7d2bc7f52db2b756b40df26.zip
hdf5-45a62b2d46523c15a7d2bc7f52db2b756b40df26.tar.gz
hdf5-45a62b2d46523c15a7d2bc7f52db2b756b40df26.tar.bz2
fix and address comments
Diffstat (limited to 'src/H5B2cache.c')
-rw-r--r--src/H5B2cache.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/H5B2cache.c b/src/H5B2cache.c
index 09bb389..65286e6 100644
--- a/src/H5B2cache.c
+++ b/src/H5B2cache.c
@@ -398,6 +398,7 @@ H5B2__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED le
*image++ = H5B2_HDR_VERSION;
/* B-tree type */
+ HDassert(hdr->cls->id <= 255);
*image++ = (uint8_t)hdr->cls->id;
/* Node size (in bytes) */
@@ -818,6 +819,7 @@ H5B2__cache_int_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED le
*image++ = H5B2_INT_VERSION;
/* B-tree type */
+ HDassert(internal->hdr->cls->id <= 255);
*image++ = (uint8_t)internal->hdr->cls->id;
HDassert((size_t)(image - (uint8_t *)_image) == (H5B2_INT_PREFIX_SIZE - H5B2_SIZEOF_CHKSUM));
@@ -1219,6 +1221,7 @@ H5B2__cache_leaf_serialize(const H5F_t H5_ATTR_UNUSED *f, void *_image, size_t H
*image++ = H5B2_LEAF_VERSION;
/* B-tree type */
+ HDassert(leaf->hdr->cls->id <= 255);
*image++ = (uint8_t)leaf->hdr->cls->id;
HDassert((size_t)(image - (uint8_t *)_image) == (H5B2_LEAF_PREFIX_SIZE - H5B2_SIZEOF_CHKSUM));