Skip to content

Commit 341f164

Browse files
committed
btl/am-rdma: Add assert on atomic size
The front end functions for am-rdma atomic operations only allow a 4 or 8 byte atomic. Add an assert on the progress function that the received size is less than a uint8_t can hold before assignment from a size_t. Signed-off-by: Brian Barrett <bbarrett@amazon.com>
1 parent 0475fe9 commit 341f164

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

opal/mca/btl/base/btl_base_am_rdma.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,8 @@ static inline int am_rdma_advance(mca_btl_base_am_rdma_module_t *am_module,
403403
hdr->data.rdma.size = packet_size;
404404
hdr->data.rdma.initiator_address = (uint64_t) context->local_address + context->sent;
405405
} else {
406+
/* atomics today are single datatype entries */
407+
assert(packet_size < UINT8_MAX);
406408
hdr->data.atomic.size = packet_size;
407409
}
408410

0 commit comments

Comments
 (0)