Browse Source

#bug 580: prevent crash in case of hicum2 default parameter set

pre-master-46
dwarning 4 years ago
committed by Holger Vogt
parent
commit
4038dd3a7f
  1. 4
      src/spicelib/devices/hicum2/hicum2acld.c
  2. 4
      src/spicelib/devices/hicum2/hicum2pzld.c
  3. 2
      src/spicelib/devices/hicum2/hicum2setup.c
  4. 2
      src/spicelib/devices/hicum2/hicumL2.cpp

4
src/spicelib/devices/hicum2/hicum2acld.c

@ -121,8 +121,8 @@ HICUMacLoad(GENmodel *inModel, CKTcircuit *ckt)
/* loop through all the models */
for( ; model != NULL; model = HICUMnextModel(model)) {
int selfheat = ( (model->HICUMflsh > 0) && (model->HICUMrthGiven) && (model->HICUMrth > 0.0));
int nqs = ( (model->HICUMflnqs != 0 || model->HICUMflcomp < 2.3) && (model->HICUMalit > 0 || model->HICUMalqf > 0));
int selfheat = ((model->HICUMflsh > 0) && (model->HICUMrthGiven) && (model->HICUMrth > 0.0));
int nqs = ((model->HICUMflnqs != 0 || model->HICUMflcomp < 2.3) && (model->HICUMt0Given) && (model->HICUMt0 > 0.0) && (model->HICUMalit > 0 || model->HICUMalqf > 0));
/* loop through all the instances of the model */
for( here = HICUMinstances(model); here!= NULL;

4
src/spicelib/devices/hicum2/hicum2pzld.c

@ -122,8 +122,8 @@ HICUMpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s)
/* loop through all the models */
for( ; model != NULL; model = HICUMnextModel(model)) {
int selfheat = ( (model->HICUMflsh > 0) && (model->HICUMrthGiven) && (model->HICUMrth > 0.0));
int nqs = ( (model->HICUMflnqs != 0 || model->HICUMflcomp < 2.3) && (model->HICUMalit > 0 || model->HICUMalqf > 0));
int selfheat = ((model->HICUMflsh > 0) && (model->HICUMrthGiven) && (model->HICUMrth > 0.0));
int nqs = ((model->HICUMflnqs != 0 || model->HICUMflcomp < 2.3) && (model->HICUMt0Given) && (model->HICUMt0 > 0.0) && (model->HICUMalit > 0 || model->HICUMalqf > 0));
/* loop through all the instances of the model */
for( here = HICUMinstances(model); here!= NULL;

2
src/spicelib/devices/hicum2/hicum2setup.c

@ -474,7 +474,7 @@ HICUMsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
model->HICUMvceMax = 1e99;
int selfheat = (((model->HICUMflsh == 1) || (model->HICUMflsh == 2)) && (model->HICUMrthGiven) && (model->HICUMrth > 0.0));
int nqs = ( (model->HICUMflnqs != 0 || model->HICUMflcomp < 2.3) && (model->HICUMalit > 0 || model->HICUMalqf > 0));
int nqs = ((model->HICUMflnqs != 0 || model->HICUMflcomp < 2.3) && (model->HICUMt0Given) && (model->HICUMt0 > 0.0) && (model->HICUMalit > 0 || model->HICUMalqf > 0));
/* loop through all the instances of the model */
for (here = HICUMinstances(model); here != NULL ;

2
src/spicelib/devices/hicum2/hicumL2.cpp

@ -1108,7 +1108,7 @@ HICUMload(GENmodel *inModel, CKTcircuit *ckt)
// Model_initialization
int selfheat = ((model->HICUMflsh > 0) && (model->HICUMrthGiven) && (model->HICUMrth > 0.0));
int nqs = ((model->HICUMflnqs != 0 || model->HICUMflcomp < 2.3) && (model->HICUMalit > 0 || model->HICUMalqf > 0));
int nqs = ((model->HICUMflnqs != 0 || model->HICUMflcomp < 2.3) && (model->HICUMt0Given) && (model->HICUMt0 > 0.0) && (model->HICUMalit > 0 || model->HICUMalqf > 0));
// Avoid divide-by-zero and define infinity other way
// High current correction for 2D and 3D effects

Loading…
Cancel
Save