diff --git a/src/spicelib/devices/asrc/asrcload.c b/src/spicelib/devices/asrc/asrcload.c index 4743e7057..8a34bc358 100644 --- a/src/spicelib/devices/asrc/asrcload.c +++ b/src/spicelib/devices/asrc/asrcload.c @@ -74,12 +74,9 @@ ASRCload(GENmodel *inModel, CKTcircuit *ckt) here->ASRCprev_value = rhs; /* The ac load precomputation and storage */ - if (ckt->CKTmode & MODEINITSMSIG) { - int size = here->ASRCtree->numVars + 1; - here->ASRCacValues = TMALLOC(double, size); + if (ckt->CKTmode & MODEINITSMSIG) for (i = 0; i < here->ASRCtree->numVars; i++) here->ASRCacValues[i] = asrc_derivs[i]; - } if (here->ASRCtype == ASRC_VOLTAGE) { diff --git a/src/spicelib/devices/asrc/asrcset.c b/src/spicelib/devices/asrc/asrcset.c index 2194bcf04..fbc64e9cd 100644 --- a/src/spicelib/devices/asrc/asrcset.c +++ b/src/spicelib/devices/asrc/asrcset.c @@ -62,6 +62,7 @@ ASRCsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) } here->ASRCposptr = TMALLOC(double *, j); + here->ASRCacValues = TMALLOC(double *, here->ASRCtree->numVars + 1); /* For each controlling variable set the entries in the vector of the positions of the SMP */