diff --git a/src/frontend/spiceif.c b/src/frontend/spiceif.c index 1077a3f72..35ae3561c 100644 --- a/src/frontend/spiceif.c +++ b/src/frontend/spiceif.c @@ -616,6 +616,7 @@ finddev_special( // assert(third && *third == NULL); for all invocations err = ft_sim->findInstance (ckt, &type, devptr, name); + err = *devptr ? OK : E_NODEV; if (err == OK) { *device_or_model = 0; return (type); @@ -1218,6 +1219,7 @@ finddev(CKTcircuit *ckt, char *name, GENinstance **devptr, GENmodel **modptr) // assert(third && *third == NULL); for all invocations err = ft_sim->findInstance (ckt, &type, devptr, name); + err = *devptr ? OK : E_NODEV; if (err == OK) return (type); diff --git a/src/spicelib/analysis/noisean.c b/src/spicelib/analysis/noisean.c index 3e274765e..515bc6426 100644 --- a/src/spicelib/analysis/noisean.c +++ b/src/spicelib/analysis/noisean.c @@ -50,6 +50,7 @@ NOISEan (CKTcircuit *ckt, int restart) if (code != -1) { // assert(third && *third == NULL); error = CKTfndDev(ckt, NULL, &inst, job->input); + error = inst ? OK : E_NODEV; if (!error && !((VSRCinstance *)inst)->VSRCacGiven) { errMsg = TMALLOC(char, strlen(noacinput) + 1); strcpy(errMsg,noacinput); @@ -61,6 +62,7 @@ NOISEan (CKTcircuit *ckt, int restart) if (code != -1 && inst==NULL) { // assert(third && *third == NULL); error = CKTfndDev(ckt, NULL, &inst, job->input); + error = inst ? OK : E_NODEV; if (error) { /* XXX ??? */ SPfrontEnd->IFerror (ERR_WARNING, diff --git a/src/spicelib/analysis/tfanal.c b/src/spicelib/analysis/tfanal.c index 5fe9d3f5e..4a811d8d0 100644 --- a/src/spicelib/analysis/tfanal.c +++ b/src/spicelib/analysis/tfanal.c @@ -53,6 +53,7 @@ TFanal(CKTcircuit *ckt, int restart) if(Itype != -1) { // assert(third && *third == NULL); error = CKTfndDev(ckt, NULL, &ptr, job->TFinSrc); + error = ptr ? OK : E_NODEV; if(error ==0) { job->TFinIsI = 1; job->TFinIsV = 0; @@ -64,6 +65,7 @@ TFanal(CKTcircuit *ckt, int restart) if( (Vtype != -1) && (ptr==NULL) ) { // assert(third && *third == NULL); error = CKTfndDev(ckt, NULL, &ptr, job->TFinSrc); + error = ptr ? OK : E_NODEV; job->TFinIsV = 1; job->TFinIsI = 0; if(error !=0) { diff --git a/src/spicelib/devices/cktcrte.c b/src/spicelib/devices/cktcrte.c index a113a5763..9918a1eda 100644 --- a/src/spicelib/devices/cktcrte.c +++ b/src/spicelib/devices/cktcrte.c @@ -31,6 +31,7 @@ CKTcrtElt(CKTcircuit *ckt, GENmodel *modPtr, GENinstance **inInstPtr, IFuid name // assert(third && *third == NULL); error = CKTfndDev(ckt, NULL, &instPtr, name); + error = instPtr ? OK : E_NODEV; if (error == OK) { if (inInstPtr) diff --git a/src/spicelib/devices/ind/mutsetup.c b/src/spicelib/devices/ind/mutsetup.c index f43654fca..0c10e20b7 100644 --- a/src/spicelib/devices/ind/mutsetup.c +++ b/src/spicelib/devices/ind/mutsetup.c @@ -45,6 +45,7 @@ MUTsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) // assert(third); error = CKTfndDev(ckt, NULL, (GENinstance **) &(here->MUTind1), here->MUTindName1); + error = here->MUTind1 ? OK : E_NODEV; if(error) { IFuid namarray[2]; namarray[0]=here->MUTname; @@ -55,6 +56,7 @@ MUTsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) } // assert(third); error = CKTfndDev(ckt, NULL, (GENinstance **) &(here->MUTind2), here->MUTindName2); + error = here->MUTind2 ? OK : E_NODEV; if(error) { IFuid namarray[2]; namarray[0]=here->MUTname; diff --git a/src/spicelib/parser/inpaname.c b/src/spicelib/parser/inpaname.c index 4878a9536..29cfedc9f 100644 --- a/src/spicelib/parser/inpaname.c +++ b/src/spicelib/parser/inpaname.c @@ -42,6 +42,7 @@ INPaName(char *parm, IFvalue * val, CKTcircuit *ckt, int *dev, char *devnam, */ // assert(third) for all invocations error = sim->findInstance (ckt, dev, fast, devnam); + error = *fast ? OK : E_NODEV; if (error) return (error); diff --git a/src/tclspice.c b/src/tclspice.c index f03d3f287..3157903ad 100644 --- a/src/tclspice.c +++ b/src/tclspice.c @@ -1396,6 +1396,7 @@ get_mod_param TCL_CMDPROCARGS(clientData, interp, argc, argv) INPretrieve(&name, ft_curckt->ci_symtab); // assert(third && *third == NULL); err = ft_sim->findInstance (ft_curckt->ci_ckt, &typecode, &devptr, name); + err = devptr ? OK : E_NODEV; if (err != OK) { typecode = -1; devptr = NULL; diff --git a/src/unsupported/snstart.c b/src/unsupported/snstart.c index 389457415..0909f1d40 100644 --- a/src/unsupported/snstart.c +++ b/src/unsupported/snstart.c @@ -44,6 +44,7 @@ SENstartup(CKTcircuit *ckt, int restart) // assert(third && *third == NULL); err = CKTfndDev(ckt, &type, &fast, ckt->CKTsenInfo->SENdevices[i]); + err = fast ? OK : E_NODEV; if (err != OK) return err;