Skip to content

Commit

Permalink
Update cint4c1e.c
Browse files Browse the repository at this point in the history
int4c1e segfault fix
  • Loading branch information
ilygatsika authored and sunqm committed Sep 13, 2023
1 parent 7086956 commit 9dd786d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cint4c1e.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ CACHE_SIZE_T CINT4c1e_drv(double *out, FINT *dims, CINTEnvVars *envs, CINTOpt *o
CACHE_SIZE_T leng = envs->g_size*3*((1<<envs->gbits)+1);
CACHE_SIZE_T len0 = envs->nf*n_comp;
CACHE_SIZE_T cache_size = MAX(leng+len0+nc*n_comp*3 + pdata_size,
nc*n_comp+envs->nf*4);
nc*n_comp+envs->nf*32*OF_CMPLX);
return cache_size;
}
double *stack = NULL;
Expand All @@ -280,7 +280,7 @@ CACHE_SIZE_T CINT4c1e_drv(double *out, FINT *dims, CINTEnvVars *envs, CINTOpt *o
size_t leng = envs->g_size*3*((1<<envs->gbits)+1);
size_t len0 = envs->nf*n_comp;
size_t cache_size = MAX(leng+len0+nc*n_comp*3 + pdata_size,
nc*n_comp+envs->nf*4);
nc*n_comp+envs->nf*32*OF_CMPLX);
stack = malloc(sizeof(double)*cache_size);
cache = stack;
}
Expand Down

0 comments on commit 9dd786d

Please sign in to comment.