summaryrefslogtreecommitdiff
path: root/cad/spice/files/patch-src_lib_fte_device_c
blob: ed6414a8835e32255f71f5025bf0345313dfa684 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
--- src/lib/fte/device.c.orig	1993-07-30 02:09:59.000000000 +0000
+++ src/lib/fte/device.c	2011-07-26 23:17:58.000000000 +0000
@@ -14,6 +14,8 @@
 #include "ftedefs.h"
 #include "dgen.h"
 
+void com_alter_common(wordlist *wl, int do_model);
+
 static wordlist *devexpand();
 
 /*
@@ -576,6 +578,7 @@
     com_alter_common(wl, 1);
 }
 
+void
 com_alter_common(wl, do_model)
     wordlist *wl;
     int	do_model;
@@ -619,7 +622,7 @@
 	n2 = names;
     }
 
-    if (!n2 || !eq(n2->pn_op->op_name, "=")) {
+    if (!n2 || !n2->pn_op || !eq(n2->pn_op->op_name, "=")) {
 	fprintf(cp_err, "alter: don't understand \"%s\"\n", names->pn_name);
 	fprintf(cp_err, "usage: alter dev param = expression\n");
 	fprintf(cp_err, "  or   alter @dev[param] = expression\n");
@@ -661,7 +664,9 @@
     }
 
     dv = ft_evaluate(n2->pn_right);
-    free_pnode(names);
+    /* prevent names from getting freed twice
+       Guenther Roehrich 22-Jan-99 */
+    /* free_pnode(names); */
     if (!dv)
 	return;
     if (dv->v_length < 1) {