From 106b92687b50399fe8dbdfec2a7879006f9fd8da Mon Sep 17 00:00:00 2001 From: sfilippone Date: Wed, 24 Apr 2024 12:20:21 +0200 Subject: [PATCH] Make sure not to call a%a%get_nrows() when not guaranteed --- base/serial/impl/psb_c_mat_impl.F90 | 10 +++++----- base/serial/impl/psb_d_mat_impl.F90 | 10 +++++----- base/serial/impl/psb_s_mat_impl.F90 | 10 +++++----- base/serial/impl/psb_z_mat_impl.F90 | 10 +++++----- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/base/serial/impl/psb_c_mat_impl.F90 b/base/serial/impl/psb_c_mat_impl.F90 index 37d6083c..8c1a28e1 100644 --- a/base/serial/impl/psb_c_mat_impl.F90 +++ b/base/serial/impl/psb_c_mat_impl.F90 @@ -2797,7 +2797,7 @@ function psb_c_rowsum(a,info) result(d) call psb_errpush(info,name) goto 9999 endif - allocate(d(max(1,a%a%get_nrows())), stat=info) + allocate(d(max(1,a%get_nrows())), stat=info) if (info /= psb_success_) goto 9999 if (allocated(a%a)) then call a%a%rowsum(d) @@ -2840,7 +2840,7 @@ function psb_c_arwsum(a,info) result(d) call psb_errpush(info,name) goto 9999 endif - allocate(d(max(1,a%a%get_nrows())), stat=info) + allocate(d(max(1,a%get_nrows())), stat=info) if (info /= psb_success_) goto 9999 if (allocated(a%a)) then @@ -2884,7 +2884,7 @@ function psb_c_colsum(a,info) result(d) call psb_errpush(info,name) goto 9999 endif - allocate(d(max(1,a%a%get_ncols())), stat=info) + allocate(d(max(1,a%get_ncols())), stat=info) if (info /= psb_success_) goto 9999 if (allocated(a%a)) then @@ -2928,7 +2928,7 @@ function psb_c_aclsum(a,info) result(d) call psb_errpush(info,name) goto 9999 endif - allocate(d(max(1,a%a%get_ncols())), stat=info) + allocate(d(max(1,a%get_ncols())), stat=info) if (info /= psb_success_) goto 9999 if (allocated(a%a)) then @@ -2973,7 +2973,7 @@ function psb_c_get_diag(a,info) result(d) call psb_errpush(info,name) goto 9999 endif - allocate(d(max(1,min(a%a%get_nrows(),a%a%get_ncols()))), stat=info) + allocate(d(max(1,min(a%get_nrows(),a%get_ncols()))), stat=info) if (info /= 0) then info = psb_err_alloc_dealloc_ call psb_errpush(info,name) diff --git a/base/serial/impl/psb_d_mat_impl.F90 b/base/serial/impl/psb_d_mat_impl.F90 index 0777d179..6453fecf 100644 --- a/base/serial/impl/psb_d_mat_impl.F90 +++ b/base/serial/impl/psb_d_mat_impl.F90 @@ -2797,7 +2797,7 @@ function psb_d_rowsum(a,info) result(d) call psb_errpush(info,name) goto 9999 endif - allocate(d(max(1,a%a%get_nrows())), stat=info) + allocate(d(max(1,a%get_nrows())), stat=info) if (info /= psb_success_) goto 9999 if (allocated(a%a)) then call a%a%rowsum(d) @@ -2840,7 +2840,7 @@ function psb_d_arwsum(a,info) result(d) call psb_errpush(info,name) goto 9999 endif - allocate(d(max(1,a%a%get_nrows())), stat=info) + allocate(d(max(1,a%get_nrows())), stat=info) if (info /= psb_success_) goto 9999 if (allocated(a%a)) then @@ -2884,7 +2884,7 @@ function psb_d_colsum(a,info) result(d) call psb_errpush(info,name) goto 9999 endif - allocate(d(max(1,a%a%get_ncols())), stat=info) + allocate(d(max(1,a%get_ncols())), stat=info) if (info /= psb_success_) goto 9999 if (allocated(a%a)) then @@ -2928,7 +2928,7 @@ function psb_d_aclsum(a,info) result(d) call psb_errpush(info,name) goto 9999 endif - allocate(d(max(1,a%a%get_ncols())), stat=info) + allocate(d(max(1,a%get_ncols())), stat=info) if (info /= psb_success_) goto 9999 if (allocated(a%a)) then @@ -2973,7 +2973,7 @@ function psb_d_get_diag(a,info) result(d) call psb_errpush(info,name) goto 9999 endif - allocate(d(max(1,min(a%a%get_nrows(),a%a%get_ncols()))), stat=info) + allocate(d(max(1,min(a%get_nrows(),a%get_ncols()))), stat=info) if (info /= 0) then info = psb_err_alloc_dealloc_ call psb_errpush(info,name) diff --git a/base/serial/impl/psb_s_mat_impl.F90 b/base/serial/impl/psb_s_mat_impl.F90 index 217f8c8b..d6ea8403 100644 --- a/base/serial/impl/psb_s_mat_impl.F90 +++ b/base/serial/impl/psb_s_mat_impl.F90 @@ -2797,7 +2797,7 @@ function psb_s_rowsum(a,info) result(d) call psb_errpush(info,name) goto 9999 endif - allocate(d(max(1,a%a%get_nrows())), stat=info) + allocate(d(max(1,a%get_nrows())), stat=info) if (info /= psb_success_) goto 9999 if (allocated(a%a)) then call a%a%rowsum(d) @@ -2840,7 +2840,7 @@ function psb_s_arwsum(a,info) result(d) call psb_errpush(info,name) goto 9999 endif - allocate(d(max(1,a%a%get_nrows())), stat=info) + allocate(d(max(1,a%get_nrows())), stat=info) if (info /= psb_success_) goto 9999 if (allocated(a%a)) then @@ -2884,7 +2884,7 @@ function psb_s_colsum(a,info) result(d) call psb_errpush(info,name) goto 9999 endif - allocate(d(max(1,a%a%get_ncols())), stat=info) + allocate(d(max(1,a%get_ncols())), stat=info) if (info /= psb_success_) goto 9999 if (allocated(a%a)) then @@ -2928,7 +2928,7 @@ function psb_s_aclsum(a,info) result(d) call psb_errpush(info,name) goto 9999 endif - allocate(d(max(1,a%a%get_ncols())), stat=info) + allocate(d(max(1,a%get_ncols())), stat=info) if (info /= psb_success_) goto 9999 if (allocated(a%a)) then @@ -2973,7 +2973,7 @@ function psb_s_get_diag(a,info) result(d) call psb_errpush(info,name) goto 9999 endif - allocate(d(max(1,min(a%a%get_nrows(),a%a%get_ncols()))), stat=info) + allocate(d(max(1,min(a%get_nrows(),a%get_ncols()))), stat=info) if (info /= 0) then info = psb_err_alloc_dealloc_ call psb_errpush(info,name) diff --git a/base/serial/impl/psb_z_mat_impl.F90 b/base/serial/impl/psb_z_mat_impl.F90 index d87e5a07..d39d776d 100644 --- a/base/serial/impl/psb_z_mat_impl.F90 +++ b/base/serial/impl/psb_z_mat_impl.F90 @@ -2797,7 +2797,7 @@ function psb_z_rowsum(a,info) result(d) call psb_errpush(info,name) goto 9999 endif - allocate(d(max(1,a%a%get_nrows())), stat=info) + allocate(d(max(1,a%get_nrows())), stat=info) if (info /= psb_success_) goto 9999 if (allocated(a%a)) then call a%a%rowsum(d) @@ -2840,7 +2840,7 @@ function psb_z_arwsum(a,info) result(d) call psb_errpush(info,name) goto 9999 endif - allocate(d(max(1,a%a%get_nrows())), stat=info) + allocate(d(max(1,a%get_nrows())), stat=info) if (info /= psb_success_) goto 9999 if (allocated(a%a)) then @@ -2884,7 +2884,7 @@ function psb_z_colsum(a,info) result(d) call psb_errpush(info,name) goto 9999 endif - allocate(d(max(1,a%a%get_ncols())), stat=info) + allocate(d(max(1,a%get_ncols())), stat=info) if (info /= psb_success_) goto 9999 if (allocated(a%a)) then @@ -2928,7 +2928,7 @@ function psb_z_aclsum(a,info) result(d) call psb_errpush(info,name) goto 9999 endif - allocate(d(max(1,a%a%get_ncols())), stat=info) + allocate(d(max(1,a%get_ncols())), stat=info) if (info /= psb_success_) goto 9999 if (allocated(a%a)) then @@ -2973,7 +2973,7 @@ function psb_z_get_diag(a,info) result(d) call psb_errpush(info,name) goto 9999 endif - allocate(d(max(1,min(a%a%get_nrows(),a%a%get_ncols()))), stat=info) + allocate(d(max(1,min(a%get_nrows(),a%get_ncols()))), stat=info) if (info /= 0) then info = psb_err_alloc_dealloc_ call psb_errpush(info,name)