X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/35ad1096448eee67fa2c3c74b62fbfa9893b43c2..1746e0d39563b9a808ae7d76baaf0ad344d33ee6:/src/smpi/mpi/smpi_datatype.cpp diff --git a/src/smpi/mpi/smpi_datatype.cpp b/src/smpi/mpi/smpi_datatype.cpp index 158bb2ea8a..a7ea791711 100644 --- a/src/smpi/mpi/smpi_datatype.cpp +++ b/src/smpi/mpi/smpi_datatype.cpp @@ -356,7 +356,7 @@ int Datatype::copy(const void* sendbuf, int sendcount, MPI_Datatype sendtype, vo int count = sendcount < recvcount ? sendcount : recvcount; XBT_DEBUG("Copying %d bytes from %p to %p", count, sendbuf, recvbuf); if (not(sendtype->flags() & DT_FLAG_DERIVED) && not(recvtype->flags() & DT_FLAG_DERIVED)) { - if (not smpi_process()->replaying()) + if (not smpi_process()->replaying() && count > 0) memcpy(recvbuf, sendbuf, count); } else if (not(sendtype->flags() & DT_FLAG_DERIVED)) { recvtype->unserialize(sendbuf, recvbuf, count / recvtype->size(), MPI_REPLACE);