modnames was restored on regular returns.
it was not restored on error returns.
consider this a bug.
if we assume it was saved for error returns as well,
then modnames need not be passed by reference,
and the unreferenced variant need not be restored.
we see now more clearly,
that a wl_free of the locally prepended new elements
to modnames should be freed on return.
lives in
inp_subcktexpand() where it is used and passed to doit()
doit()
where it is (read only) used, and passed to doit() modtranslate() and translate()
does a strance protect,
translate()
where it not used, but passed to numnodes()
numnodes()
where it is used read-only
modtranslate()
where it is used to insert at the front
submod0 is only aceesd in doit,
always set NULL on entry,
(almost) always restored on return
was not restored on error ...
fixme check this changed behaviour
doit()
uses this list, and executes modtranslate() and devmodtranslate()
modtranslate()
uses submod, to prepend to the list
devmodtranslate()
just traverses the list
nobody looks at subs0, except doit().
doit() allways initializes it to NULL,
and restores it on return
thus its a local ...
note:
in error cases subs is *not* allways restored
assume this to have been a bug
in response to the `ex-41.cir' test case
distilled from a Dietmar Warning Bug report in
"Subject: Re: subckt, param"
translate() is called recursively and depends on
`num of nodes' provided by numnodes().
numnodes() depends on availability of `su_numargs'.
But the processing allows non-processing of subckt instantiations
in inner recursions (which will be processed later)
which means `su_numargs' is not always available.