From 95f656689d44581086bb149393357f6358a2d172 Mon Sep 17 00:00:00 2001 From: William Dawson Date: Thu, 29 Feb 2024 18:26:01 +0900 Subject: [PATCH] Backport fixes (#188) to 2.7.1 --- Source/C/TripletList_c.h | 2 +- .../dense_includes/CheckMemoryPoolValidity.f90 | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Source/C/TripletList_c.h b/Source/C/TripletList_c.h index d63af3a6..9afc00cd 100644 --- a/Source/C/TripletList_c.h +++ b/Source/C/TripletList_c.h @@ -8,7 +8,7 @@ void AppendToTripletList_r_wrp(int *ih_this, const int *index_column, void SetTripletAt_r_wrp(int *ih_this, const int *index, const int *index_column, const int *index_row, const double *point_value); void GetTripletAt_r_wrp(const int *ih_this, const int *index, int *index_column, - const int *index_row, double *point_value); + int *index_row, double *point_value); void DestructTripletList_r_wrp(int *ih_this); void SortTripletList_r_wrp(const int *ih_this, const int *matrix_size, int *h_sorted); diff --git a/Source/Fortran/dense_includes/CheckMemoryPoolValidity.f90 b/Source/Fortran/dense_includes/CheckMemoryPoolValidity.f90 index fe3d7a99..9fc6d70d 100644 --- a/Source/Fortran/dense_includes/CheckMemoryPoolValidity.f90 +++ b/Source/Fortran/dense_includes/CheckMemoryPoolValidity.f90 @@ -3,10 +3,12 @@ IF (.NOT. ALLOCATED(this%pruned_list)) isvalid = .FALSE. IF (.NOT. ALLOCATED(this%value_array)) isvalid = .FALSE. - !! Check allocation size - IF (.NOT. SIZE(this%value_array,dim=2) .EQ. rows) THEN - isvalid = .FALSE. - END IF - IF (.NOT. SIZE(this%value_array,dim=1) .EQ. columns) THEN - isvalid = .FALSE. + IF (isvalid) THEN + !! Check allocation size + IF (.NOT. SIZE(this%value_array,dim=2) .EQ. rows) THEN + isvalid = .FALSE. + END IF + IF (.NOT. SIZE(this%value_array,dim=1) .EQ. columns) THEN + isvalid = .FALSE. + END IF END IF