diff --git a/src/spicelib/devices/ind/mutsetup.c b/src/spicelib/devices/ind/mutsetup.c index 0379e4061..9960b0c7c 100644 --- a/src/spicelib/devices/ind/mutsetup.c +++ b/src/spicelib/devices/ind/mutsetup.c @@ -43,7 +43,8 @@ MUTsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) } // assert(third); - here->MUTind1 = (INDinstance *) CKTfndDev(ckt, NULL, (GENinstance **) &(here->MUTind1), here->MUTindName1); + if (!here->MUTind1) + here->MUTind1 = (INDinstance *) CKTfndDev(ckt, NULL, NULL, here->MUTindName1); if (!here->MUTind1) { IFuid namarray[2]; namarray[0]=here->MUTname; @@ -53,7 +54,8 @@ MUTsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) namarray); } // assert(third); - here->MUTind2 = (INDinstance *) CKTfndDev(ckt, NULL, (GENinstance **) &(here->MUTind2), here->MUTindName2); + if (!here->MUTind2) + here->MUTind2 = (INDinstance *) CKTfndDev(ckt, NULL, NULL, here->MUTindName2); if (!here->MUTind2) { IFuid namarray[2]; namarray[0]=here->MUTname; diff --git a/src/spicelib/parser/inpaname.c b/src/spicelib/parser/inpaname.c index 0c9b64005..08dfa47a9 100644 --- a/src/spicelib/parser/inpaname.c +++ b/src/spicelib/parser/inpaname.c @@ -41,7 +41,8 @@ INPaName(char *parm, IFvalue * val, CKTcircuit *ckt, int *dev, char *devnam, * WILL be set on return unless error is not OK */ // assert(third) for all invocations - *fast = sim->findInstance (ckt, NULL, fast, devnam); + if (*fast == NULL) + *fast = sim->findInstance (ckt, NULL, NULL, devnam); if (*fast == NULL) return (E_NODEV);