Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix null pointer dereference.
[simgrid.git] / src / s4u / s4u_Comm.cpp
index 8f0fc88..a841ac4 100644 (file)
@@ -4,6 +4,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "src/msg/msg_private.hpp"
+#include "src/simix/ActorImpl.hpp"
 #include "xbt/log.h"
 
 #include "simgrid/Exception.hpp"
@@ -227,6 +228,11 @@ MailboxPtr Comm::get_mailbox()
   return mailbox_;
 }
 
+ActorPtr Comm::get_sender()
+{
+  return sender_ ? sender_->iface() : nullptr;
+}
+
 void intrusive_ptr_release(simgrid::s4u::Comm* c)
 {
   if (c->refcount_.fetch_sub(1, std::memory_order_release) == 1) {