Browse Source

INPgetTree(), express the live range of some globals

rlar 14 years ago
parent
commit
4fb75fbd51
  1. 32
      src/spicelib/parser/inpptree.c

32
src/spicelib/parser/inpptree.c

@ -141,24 +141,32 @@ INPgetTree(char **line, INPparseTree ** pt, CKTcircuit *ckt, INPtables * tab)
rv = PTparse(line, &p, ckt);
if (rv || !PTcheck(p)) {
*pt = NULL;
return;
}
(*pt) = TMALLOC(INPparseTree, 1);
} else {
(*pt) = TMALLOC(INPparseTree, 1);
(*pt)->p.numVars = numvalues;
(*pt)->p.varTypes = types;
(*pt)->p.vars = values;
(*pt)->p.IFeval = IFeval;
(*pt)->tree = p;
(*pt)->p.numVars = numvalues;
(*pt)->p.varTypes = types;
(*pt)->p.vars = values;
(*pt)->p.IFeval = IFeval;
(*pt)->tree = p;
(*pt)->derivs = TMALLOC(INPparseNode *, numvalues);
(*pt)->derivs = TMALLOC(INPparseNode *, numvalues);
for (i = 0; i < numvalues; i++)
(*pt)->derivs[i] = PTdifferentiate(p, i);
for (i = 0; i < numvalues; i++)
(*pt)->derivs[i] = PTdifferentiate(p, i);
return;
}
values = NULL;
types = NULL;
numvalues = 0;
circuit = NULL;
tables = NULL;
}
/* This routine takes the partial derivative of the parse tree with respect to

Loading…
Cancel
Save