summaryrefslogtreecommitdiffstats
path: root/src/H5Ocache.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Ocache.c')
-rw-r--r--src/H5Ocache.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/H5Ocache.c b/src/H5Ocache.c
index 098746b..74083e4 100644
--- a/src/H5Ocache.c
+++ b/src/H5Ocache.c
@@ -169,19 +169,16 @@ H5O_flush_msgs(H5F_t *f, H5O_t *oh)
encode = H5O_MSG_SHARED->encode;
else
encode = curr_msg->type->encode;
-/* XXX: fix me */
-#ifdef NOT_YET
+#ifndef NDEBUG
+/* Sanity check that the message won't overwrite past it's allocated space */
if(!(curr_msg->flags & H5O_MSG_FLAG_SHARED)) {
size_t msg_size;
- HDfprintf(stderr, "%s: curr_msg->type->name = '%s'\n", FUNC, curr_msg->type->name);
- HDfprintf(stderr, "%s: curr_msg->raw_size = %Zu\n", FUNC, curr_msg->raw_size);
msg_size = curr_msg->type->raw_size(f, curr_msg->native);
- HDfprintf(stderr, "%s: msg_size = %Zu\n", FUNC, msg_size);
- if(msg_size > curr_msg->raw_size)
- HDfprintf(stderr, "%s: YOW!\n", FUNC);
+ msg_size = H5O_ALIGN_OH(oh, msg_size);
+ HDassert(msg_size <= curr_msg->raw_size);
} /* end if */
-#endif /* NOT_YET */
+#endif /* NDEBUG */
if((encode)(f, curr_msg->raw, curr_msg->native) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTENCODE, FAIL, "unable to encode object header message")
} /* end if */