From c920946c739896cd3ccf724b0db9e01600495ae3 Mon Sep 17 00:00:00 2001 From: rlar Date: Sun, 26 Mar 2017 11:14:35 +0200 Subject: [PATCH] inp.c, bug fix, need to reset modtlist/devtlist unconditionally --- src/frontend/inp.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/frontend/inp.c b/src/frontend/inp.c index 5ea2a0b0f..26403782e 100644 --- a/src/frontend/inp.c +++ b/src/frontend/inp.c @@ -76,6 +76,13 @@ struct pt_temper { struct pt_temper *next; }; +/* List of all expressions found in .model lines */ +static struct pt_temper *modtlist = NULL; + +/* List of all expressions found in device instance lines */ +static struct pt_temper *devtlist = NULL; + + /* * create an unique artificial *unusable* FILE ptr * meant to be used with Xprintf() only to eventually @@ -552,6 +559,11 @@ inp_spsource(FILE *fp, bool comfile, char *filename, bool intfile) cp_getvar("pretemp", CP_REAL, &testemp); printf("test temperature %f\n", testemp); } + + /* reset lists */ + modtlist = NULL; + devtlist = NULL; + /* We are done handling the control stuff. Now process remainder of deck. Go on if there is something left after the controls.*/ if (deck->li_next) { @@ -1395,12 +1407,6 @@ dotifeval(struct line *deck) } -/* List of all expressions found in .model lines */ -static struct pt_temper *modtlist = NULL; - -/* List of all expressions found in device instance lines */ -static struct pt_temper *devtlist = NULL; - /* Evaluate expressions containing 'temper' keyword, found in .model lines or device instance lines.