From 3d6a2e24227e61f0f3c8d280229462dd5480d000 Mon Sep 17 00:00:00 2001 From: rlar Date: Sun, 5 Mar 2017 16:53:29 +0100 Subject: [PATCH] inp2m.c, #12/15b, unify, add code which won't be executed at all actually, this most certainly unveils a bug in the original code, lacking invocation of INPgetModBin() when optional extra nodes come into play. --- src/spicelib/parser/inp2m.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/spicelib/parser/inp2m.c b/src/spicelib/parser/inp2m.c index aec602385..89729b175 100644 --- a/src/spicelib/parser/inp2m.c +++ b/src/spicelib/parser/inp2m.c @@ -121,7 +121,7 @@ INP2M(CKTcircuit *ckt, INPtables *tab, card *current) tfree(err_msg); /* check if using model binning -- pass in line since need 'l' and 'w' */ - if (!thismodel) + if (!thismodel && nodeflag < 5) INPgetModBin(ckt, nname[nodeflag], &thismodel, tab, line); if (!thismodel) { @@ -131,6 +131,10 @@ INP2M(CKTcircuit *ckt, INPtables *tab, card *current) err_msg = INPgetMod(ckt, nname[nodeflag], &thismodel, tab); tfree(err_msg); + /* check if using model binning -- pass in line since need 'l' and 'w' */ + if (!thismodel && nodeflag < 5) + INPgetModBin(ckt, nname[nodeflag], &thismodel, tab, line); + if (!thismodel) { nodeflag = 6; INPgetNetTok(&line, &nname[nodeflag], 1); @@ -138,6 +142,10 @@ INP2M(CKTcircuit *ckt, INPtables *tab, card *current) err_msg = INPgetMod(ckt, nname[nodeflag], &thismodel, tab); tfree(err_msg); + /* check if using model binning -- pass in line since need 'l' and 'w' */ + if (!thismodel && nodeflag < 5) + INPgetModBin(ckt, nname[nodeflag], &thismodel, tab, line); + if (!thismodel) { nodeflag = 7; INPgetTok(&line, &nname[nodeflag], 1); @@ -145,6 +153,10 @@ INP2M(CKTcircuit *ckt, INPtables *tab, card *current) err_msg = INPgetMod(ckt, nname[nodeflag], &thismodel, tab); tfree(err_msg); + /* check if using model binning -- pass in line since need 'l' and 'w' */ + if (!thismodel && nodeflag < 5) + INPgetModBin(ckt, nname[nodeflag], &thismodel, tab, line); + if (thismodel) { /* nodeflag == 7 */ if (!valid_numnodes(nodeflag, thismodel, current))