From d57b37153df98a3fa2d737240803a76918a34830 Mon Sep 17 00:00:00 2001 From: augustin degomme Date: Sat, 6 Jun 2020 11:38:16 +0200 Subject: [PATCH] Tiny fixes I was just checking than sanitizers, valgrind, and static analysis were still working. --- src/smpi/mpi/smpi_datatype_derived.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/smpi/mpi/smpi_datatype_derived.cpp b/src/smpi/mpi/smpi_datatype_derived.cpp index dd283c95d2..aa12ddcfb5 100644 --- a/src/smpi/mpi/smpi_datatype_derived.cpp +++ b/src/smpi/mpi/smpi_datatype_derived.cpp @@ -136,7 +136,7 @@ Type_Hindexed::Type_Hindexed(int size, MPI_Aint lb, MPI_Aint ub, int flags, int int* ints = new int[count+1]; ints[0]=count; for(int i=1;i<=count;i++) - ints[i]=block_lengths[i]; + ints[i]=block_lengths[i-1]; contents_ = new Datatype_contents(MPI_COMBINER_HINDEXED, count+1, ints, count, block_indices, 1, &old_type); delete[] ints; old_type_->ref(); @@ -241,8 +241,9 @@ Type_Struct::Type_Struct(int size, MPI_Aint lb, MPI_Aint ub, int flags, int coun int* ints = new int[count+1]; ints[0]=count; for(int i=1;i<=count;i++) - ints[i]=block_lengths[i]; + ints[i]=block_lengths[i-1]; contents_ = new Datatype_contents(MPI_COMBINER_INDEXED, count+1, ints, count, block_indices, count, old_types); + delete[] ints; for (int i = 0; i < count; i++) { block_lengths_[i]=block_lengths[i]; block_indices_[i]=block_indices[i]; -- 2.20.1