Fix false positives in count_from_Status etc al. n-i-bz.
authorsewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Thu, 23 Aug 2012 19:25:12 +0000 (19:25 +0000)
committersewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Thu, 23 Aug 2012 19:25:12 +0000 (19:25 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12887 a5019735-40e9-0310-863c-91ae7b9d1cf9

mpi/libmpiwrap.c

index 4bd6aac092967e98547550232a46407caf1c6de6..c03393e75f4a6d0f4db264e1e2e629de42cb68a3 100644 (file)
@@ -413,7 +413,9 @@ static __inline__ Bool count_from_Status( /*OUT*/int* recv_count,
                                       MPI_Status* status)
 {
    int n;
+   if (cONFIG_DER) VALGRIND_DISABLE_ERROR_REPORTING;
    int err = PMPI_Get_count(status, datatype, &n);
+   if (cONFIG_DER) VALGRIND_ENABLE_ERROR_REPORTING;
    if (err == MPI_SUCCESS) {
       *recv_count = n;
       return True;
@@ -1107,6 +1109,7 @@ int WRAPPER_FOR(PMPI_Recv)(void *buf, int count, MPI_Datatype datatype,
    if (cONFIG_DER) VALGRIND_DISABLE_ERROR_REPORTING;
    CALL_FN_W_7W(err, fn, buf,count,datatype,source,tag,comm,status);
    if (cONFIG_DER) VALGRIND_ENABLE_ERROR_REPORTING;
+   make_mem_defined_if_addressable_if_success_untyped(err, status, sizeof(*status));
    if (err == MPI_SUCCESS && count_from_Status(&recv_count,datatype,status)) {
       make_mem_defined_if_addressable(buf, recv_count, datatype);
    }
@@ -1724,6 +1727,7 @@ int WRAPPER_FOR(PMPI_Sendrecv)(
                           recvbuf,recvcount,recvtype,source,recvtag,
                           comm,status);
    if (cONFIG_DER) VALGRIND_ENABLE_ERROR_REPORTING;
+   make_mem_defined_if_addressable_if_success_untyped(err, status, sizeof(*status));
    if (err == MPI_SUCCESS 
        && count_from_Status(&recvcount_actual,recvtype,status)) {
       make_mem_defined_if_addressable(recvbuf, recvcount_actual, recvtype);