Skip to content

Commit dfdf315

Browse files
committed
< fix >
fix an over-bound accessing bug in distribute_method1 with gamma_only=true, by adjust the iy_end from this->ny to this->ny-1 in function collect_st and count_pw_st.
1 parent af1b58a commit dfdf315

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

source/module_pw/pw_distributeg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ void PW_Basis::count_pw_st(
5252
if (this->gamma_only)
5353
{
5454
iy_start = 0;
55-
iy_end = this->ny;
55+
iy_end = this->ny - 1;
5656
}
5757
for (int ix = -ibox[0]; ix <= ibox[0]; ++ix)
5858
{

source/module_pw/pw_distributeg_method1.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ void PW_Basis::collect_st(
223223
if (this->gamma_only)
224224
{
225225
iy_start = 0;
226-
iy_end = this->ny;
226+
iy_end = this->ny - 1;
227227
}
228228
for (int ix = -ibox[0]; ix <= ibox[0]; ++ix)
229229
{

0 commit comments

Comments
 (0)