A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
please herr sonar
[simgrid.git]
/
src
/
smpi
/
bindings
/
smpi_pmpi_coll.cpp
diff --git
a/src/smpi/bindings/smpi_pmpi_coll.cpp
b/src/smpi/bindings/smpi_pmpi_coll.cpp
index
c4f8183
..
2eb62c2
100644
(file)
--- a/
src/smpi/bindings/smpi_pmpi_coll.cpp
+++ b/
src/smpi/bindings/smpi_pmpi_coll.cpp
@@
-760,7
+760,9
@@
int PMPI_Ialltoall(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* re
MPI_Datatype sendtmptype = sendtype;
if (sendbuf == MPI_IN_PLACE) {
sendtmpbuf = static_cast<void*>(xbt_malloc(recvcount * comm->size() * recvtype->size()));
MPI_Datatype sendtmptype = sendtype;
if (sendbuf == MPI_IN_PLACE) {
sendtmpbuf = static_cast<void*>(xbt_malloc(recvcount * comm->size() * recvtype->size()));
- memcpy(sendtmpbuf, recvbuf, recvcount * comm->size() * recvtype->size());
+ //memcpy(??,nullptr,0) is actually undefined behavor, even if harmless.
+ if(recvbuf != nullptr)
+ memcpy(sendtmpbuf, recvbuf, recvcount * comm->size() * recvtype->size());
sendtmpcount = recvcount;
sendtmptype = recvtype;
}
sendtmpcount = recvcount;
sendtmptype = recvtype;
}