Browse Source

device.c, bug fix commit "device.c, #8/19, use parent wordlist ..."

This commit did rely on the existence of a parent 'wordlist' element,
  usually guranteed by a leading "alter" or "altermod" command word.
But 'inp_evaluate_temper()' passes a wordlist without any parent word
  when invoking 'com_altermod()'
pre-master-46
rlar 9 years ago
parent
commit
0db861e4a6
  1. 8
      src/frontend/device.c

8
src/frontend/device.c

@ -1118,7 +1118,7 @@ if_set_binned_model(CKTcircuit *ckt, char *devname, char *param, struct dvec *va
static void static void
com_alter_common(wordlist *wl, int do_model) com_alter_common(wordlist *wl, int do_model)
{ {
wordlist *parent = wl->wl_prev;
wordlist *wl_head = wl;
wordlist *eqword, *words; wordlist *eqword, *words;
char *dev, *param; char *dev, *param;
struct dvec *dv; struct dvec *dv;
@ -1150,6 +1150,8 @@ com_alter_common(wordlist *wl, int do_model)
if (eqptr > argument) if (eqptr > argument)
wn = wl_cons(copy_substring(argument, eqptr), wn); wn = wl_cons(copy_substring(argument, eqptr), wn);
wl_splice(wl, wn); wl_splice(wl, wn);
if (wl_head == wl)
wl_head = wn;
} }
break; break;
} }
@ -1163,7 +1165,7 @@ com_alter_common(wordlist *wl, int do_model)
* 'alter device parameter value parameter value [ parameter value ]' * 'alter device parameter value parameter value [ parameter value ]'
* with multiple param value pairs are not supported! * with multiple param value pairs are not supported!
*/ */
wordlist *wlin = parent->wl_next;
wordlist *wlin = wl_head;
int wlen = wl_length(wlin); int wlen = wl_length(wlin);
int maxelem = 3; int maxelem = 3;
/* Return the last element of wlin */ /* Return the last element of wlin */
@ -1192,7 +1194,7 @@ com_alter_common(wordlist *wl, int do_model)
wlin = wl_append(wlin, wl_cons(copy("="), wl_chop_rest(wlin))); wlin = wl_append(wlin, wl_cons(copy("="), wl_chop_rest(wlin)));
} }
wl = parent->wl_next;
wl = wl_head;
/* Everything is ready, parsing of the wordlist starts here. */ /* Everything is ready, parsing of the wordlist starts here. */
eqword = wl_find("=", wl); eqword = wl_find("=", wl);

Loading…
Cancel
Save