From: Fred Suter Date: Thu, 26 Oct 2023 20:20:51 +0000 (-0400) Subject: got issues with get_id() while debugging. Add protection X-Git-Tag: v3.35~89^2~28^2~7 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/7096c31112ac2ba4303814d1e15f6d91c635851d got issues with get_id() while debugging. Add protection --- diff --git a/src/kernel/actor/CommObserver.cpp b/src/kernel/actor/CommObserver.cpp index 7aa715de01..d860c8c221 100644 --- a/src/kernel/actor/CommObserver.cpp +++ b/src/kernel/actor/CommObserver.cpp @@ -222,8 +222,8 @@ void CommIsendSimcall::serialize(std::stringstream& stream) const } std::string CommIsendSimcall::to_string() const { - return "CommAsyncSend(comm_id: " + std::to_string(comm_->get_id()) + " mbox:" + std::to_string(mbox_->get_id()) + - " tag: " + std::to_string(tag_) + ")"; + return "CommAsyncSend(comm_id: " + std::to_string((comm_ ? comm_->get_id() : 0)) + " mbox:" + + std::to_string(mbox_->get_id()) + " tag: " + std::to_string(tag_) + ")"; } void CommIrecvSimcall::serialize(std::stringstream& stream) const @@ -237,8 +237,8 @@ void CommIrecvSimcall::serialize(std::stringstream& stream) const std::string CommIrecvSimcall::to_string() const { - return "CommAsyncRecv(comm_id: " + std::to_string(comm_->get_id()) + " mbox:" + std::to_string(mbox_->get_id()) + - " tag: " + std::to_string(tag_) + ")"; + return "CommAsyncRecv(comm_id: " + std::to_string((comm_ ? comm_->get_id() : 0)) + " mbox:" + + std::to_string(mbox_->get_id()) + " tag: " + std::to_string(tag_) + ")"; } void MessIputSimcall::serialize(std::stringstream& stream) const