check for shorted voltage sources, to avoid a segmentation fault
This commit is contained in:
parent
bfc6636b61
commit
5c59267768
|
|
@ -1,3 +1,10 @@
|
|||
2010-08-15 Robert Larice
|
||||
* src/spicelib/devices/asrc/asrcset.c ,
|
||||
* src/spicelib/devices/ccvs/ccvsset.c ,
|
||||
* src/spicelib/devices/vcvs/vcvsset.c ,
|
||||
* src/spicelib/devices/vsrc/vsrcset.c :
|
||||
check for shorted voltage sources, to avoid a segmentation fault
|
||||
|
||||
2010-08-15 Robert Larice
|
||||
* src/maths/sparse/spdefs.h :
|
||||
fix txfree() prototype
|
||||
|
|
|
|||
|
|
@ -64,6 +64,13 @@ if((here->ptr = SMPmakeElt(matrix, here->first, (second)->number))\
|
|||
return E_PARMVAL;
|
||||
|
||||
if( here->ASRCtype == ASRC_VOLTAGE) {
|
||||
|
||||
if(here->ASRCposNode == here->ASRCnegNode) {
|
||||
(*(SPfrontEnd->IFerror))(ERR_FATAL,
|
||||
"instance %s is a shorted ASRC", &here->ASRCname);
|
||||
return(E_UNSUPP);
|
||||
}
|
||||
|
||||
here->ASRCposptr = (double **)
|
||||
REALLOC(here->ASRCposptr, (sizeof(double *)*(j+5)));
|
||||
TSTALLOC(ASRCposptr[j++],ASRCposNode,ASRCbranch);
|
||||
|
|
|
|||
|
|
@ -29,6 +29,12 @@ CCVSsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
|
|||
for (here = model->CCVSinstances; here != NULL ;
|
||||
here=here->CCVSnextInstance) {
|
||||
|
||||
if(here->CCVSposNode == here->CCVSnegNode) {
|
||||
(*(SPfrontEnd->IFerror))(ERR_FATAL,
|
||||
"instance %s is a shorted CCVS", &here->CCVSname);
|
||||
return(E_UNSUPP);
|
||||
}
|
||||
|
||||
if(here->CCVSbranch==0) {
|
||||
error = CKTmkCur(ckt,&tmp,here->CCVSname, "branch");
|
||||
if(error) return(error);
|
||||
|
|
|
|||
|
|
@ -30,6 +30,12 @@ VCVSsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
|
|||
for (here = model->VCVSinstances; here != NULL ;
|
||||
here=here->VCVSnextInstance) {
|
||||
|
||||
if(here->VCVSposNode == here->VCVSnegNode) {
|
||||
(*(SPfrontEnd->IFerror))(ERR_FATAL,
|
||||
"instance %s is a shorted VCVS", &here->VCVSname);
|
||||
return(E_UNSUPP);
|
||||
}
|
||||
|
||||
if(here->VCVSbranch == 0) {
|
||||
error = CKTmkCur(ckt,&tmp,here->VCVSname,"branch");
|
||||
if(error) return(error);
|
||||
|
|
|
|||
|
|
@ -29,6 +29,12 @@ VSRCsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *state)
|
|||
for (here = model->VSRCinstances; here != NULL ;
|
||||
here=here->VSRCnextInstance) {
|
||||
|
||||
if(here->VSRCposNode == here->VSRCnegNode) {
|
||||
(*(SPfrontEnd->IFerror))(ERR_FATAL,
|
||||
"instance %s is a shorted VSRC", &here->VSRCname);
|
||||
return(E_UNSUPP);
|
||||
}
|
||||
|
||||
if(here->VSRCbranch == 0) {
|
||||
error = CKTmkCur(ckt,&tmp,here->VSRCname,"branch");
|
||||
if(error) return(error);
|
||||
|
|
|
|||
Loading…
Reference in New Issue