Skip to content

Commit 72c4ea1

Browse files
authored
Merge pull request #1200 from ddhhss/develop
Fix: Out-of-bounds memory access in v_compensating.
2 parents 434fcb7 + d0c532a commit 72c4ea1

File tree

3 files changed

+0
-6
lines changed

3 files changed

+0
-6
lines changed

source/module_surchem/H_correction_pw.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,6 @@ ModuleBase::matrix surchem::v_compensating(const UnitCell &cell,
166166

167167
rho_basis->real2recip(Porter, Porter_g);
168168

169-
this->Porter_g_anchor = Porter_g[rho_basis->ig_gge0];
170-
171169
complex<double> *N = new complex<double>[rho_basis->npw];
172170
complex<double> *TOTN = new complex<double>[rho_basis->npw];
173171

@@ -178,7 +176,6 @@ ModuleBase::matrix surchem::v_compensating(const UnitCell &cell,
178176

179177
complex<double> *comp_reci = new complex<double>[rho_basis->npw];
180178
complex<double> *phi_comp_G = new complex<double>[rho_basis->npw];
181-
// double *phi_comp_R = new double[rho_basis->nrxx];
182179

183180
ModuleBase::GlobalFunc::ZEROS(comp_reci, rho_basis->npw);
184181
ModuleBase::GlobalFunc::ZEROS(phi_comp_G, rho_basis->npw);
@@ -234,7 +231,6 @@ ModuleBase::matrix surchem::v_compensating(const UnitCell &cell,
234231

235232
delete[] comp_reci;
236233
delete[] phi_comp_G;
237-
// delete[] phi_comp_R;
238234
delete[] Porter;
239235
delete[] Porter_g;
240236
delete[] N;

source/module_surchem/cal_vel.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ ModuleBase::matrix surchem::cal_vel(const UnitCell &cell,
5757
ModuleBase::TITLE("surchem", "cal_vel");
5858
ModuleBase::timer::tick("surchem", "cal_vel");
5959

60-
// double *TOTN_real = new double[pwb.nrxx];
6160
rho_basis->recip2real(TOTN, TOTN_real);
6261

6362
// -4pi * TOTN(G)

source/module_surchem/surchem.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ class surchem
2424
ModuleBase::matrix Vcav;
2525
ModuleBase::matrix Vel;
2626
double qs;
27-
complex<double> Porter_g_anchor;
2827

2928
// compensating charge (in real space, used to cal_Acomp)
3029
double *comp_real;

0 commit comments

Comments
 (0)