From 02555fbe99d090ede9a0a5e5a1f14bce27727319 Mon Sep 17 00:00:00 2001 From: h_vogt Date: Sun, 20 Oct 2013 13:51:18 +0200 Subject: [PATCH] bug reported by Yamamaya: revert deleting dicoS structure in inp.c and measure.c: still to be used by 'listing param' deletion moved to com_remcirc() --- src/frontend/inp.c | 5 ----- src/frontend/measure.c | 3 --- src/frontend/numparam/spicenum.c | 8 ++++++-- src/frontend/runcoms2.c | 4 ++++ 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/frontend/inp.c b/src/frontend/inp.c index 33b85a812..3b6351d72 100644 --- a/src/frontend/inp.c +++ b/src/frontend/inp.c @@ -666,11 +666,6 @@ inp_spsource(FILE *fp, bool comfile, char *filename, bool intfile) prev_card = dd; } //end of for-loop - /* If we don't have .meas lines, we free the dicoS structure now. - If we have .meas lines, dicoS is freed in do_measure() */ - if (ft_curckt && !ft_curckt->ci_meas) - nupa_del_dicoS(); - /* set temperature, if defined, to new value. cp_vset will set the variable "temp" and also set CKTtemp, so we can do it only here because the circuit has to be already there */ diff --git a/src/frontend/measure.c b/src/frontend/measure.c index 925f40e96..546bf92d3 100644 --- a/src/frontend/measure.c +++ b/src/frontend/measure.c @@ -431,9 +431,6 @@ do_measure( txfree(an_name); - /* numparam data structure dicoS is no longer needed */ - nupa_del_dicoS(); - fflush(stdout); return(measures_passed); diff --git a/src/frontend/numparam/spicenum.c b/src/frontend/numparam/spicenum.c index 134b3be41..6e55602b8 100644 --- a/src/frontend/numparam/spicenum.c +++ b/src/frontend/numparam/spicenum.c @@ -472,8 +472,7 @@ nupa_init(char *srcfile) } -/* free dicoS (called from do_measure() in measure.c or - immediately from inp_spsource() in inp.c) */ +/* free dicoS (called from com_remcirc()) */ void nupa_del_dicoS(void) { @@ -594,6 +593,11 @@ nupa_list_params(FILE *cp_out) NGHASHPTR htable_p; /* current hash table */ dico_p = dicoS; + if (dico_p == NULL) { + fprintf(cp_err, "\nWarning: No symbol table available for 'listing param'\n"); + return; + } + fprintf(cp_out, "\n\n"); /* ----------------------------------------------------------------- diff --git a/src/frontend/runcoms2.c b/src/frontend/runcoms2.c index c8c868722..024cc6259 100644 --- a/src/frontend/runcoms2.c +++ b/src/frontend/runcoms2.c @@ -23,6 +23,7 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group #include "plotting/graf.h" #include "spiceif.h" #include "outitf.h" +#include "numparam/numpaif.h" #include "ngspice/inpdefs.h" @@ -216,6 +217,9 @@ com_remcirc(wordlist *wl) return; } + /* delete numparam data structure dicoS */ + nupa_del_dicoS(); + dbfree(ft_curckt->ci_dbs); ft_curckt->ci_dbs = NULL; dbs = NULL;