Skip to content

Commit

Permalink
Avoid segfault in CVODES CVAdataStore (#1351)
Browse files Browse the repository at this point in the history
Does not fix the root cause of occassional segfaults, but turns them into exceptions / integration failues.
  • Loading branch information
dweindl authored Dec 2, 2020
1 parent 156d37a commit a13db57
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ThirdParty/sundials/src/cvodes/cvodea.c
Original file line number Diff line number Diff line change
Expand Up @@ -2026,6 +2026,9 @@ static int CVAdataStore(CVodeMem cv_mem, CkpntMem ck_mem)
/* Run CVode to set following structures in dt_mem[i] */
i = 1;
do {
// Modified for AMICI
// (dt_mem has dimension ca_mem->ca_nsteps)
if (i > ca_mem->ca_nsteps) return(CV_FWD_FAIL);

flag = CVode(cv_mem, ck_mem->ck_t1, ca_mem->ca_ytmp, &t, CV_ONE_STEP);
if (flag < 0) return(CV_FWD_FAIL);
Expand Down

0 comments on commit a13db57

Please sign in to comment.