From: Martin Quinson Date: Sat, 23 Apr 2016 07:57:18 +0000 (+0200) Subject: Calling front() on empty deque is undefined X-Git-Tag: v3_13~34^2~24 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/df3d5e44a868b07107aba9bf07683d8fdb95a6d8?ds=inline Calling front() on empty deque is undefined - MSG_mailbox_is_empty supposes that it returns nullptr --- diff --git a/src/simix/smx_network.cpp b/src/simix/smx_network.cpp index f2076abefa..dcf2c73eb2 100644 --- a/src/simix/smx_network.cpp +++ b/src/simix/smx_network.cpp @@ -70,7 +70,7 @@ smx_mailbox_t SIMIX_mbox_get_by_name(const char *name) smx_synchro_t SIMIX_mbox_get_head(smx_mailbox_t mbox) { - return mbox->comm_queue->front(); + return mbox->comm_queue->empty()? nullptr:mbox->comm_queue->front(); } /**