comparison src/symbol.c @ 79:d0ce3f5f6797

Checkpointing deployment of non-constant expression handling
author lost
date Sat, 10 Jan 2009 07:09:14 +0000
parents a338d496350e
children 03be43ae19cf
comparison
equal deleted inserted replaced
78:121bf4a588ea 79:d0ce3f5f6797
90 90
91 // now look it for to see if it is a duplicate 91 // now look it for to see if it is a duplicate
92 se = lwasm_find_symbol(as, sym, scontext); 92 se = lwasm_find_symbol(as, sym, scontext);
93 if (se) 93 if (se)
94 { 94 {
95 if (flags & SYMBOL_FORCE && as -> passnum != 2)
96 {
97 register_error(as, l, 1, "Multiply defined symbol: %s", sym);
98 return -1;
99 }
95 if (!(flags & SYMBOL_SET) || (flags & SYMBOL_SET && !(se -> flags & SYMBOL_SET))) 100 if (!(flags & SYMBOL_SET) || (flags & SYMBOL_SET && !(se -> flags & SYMBOL_SET)))
96 { 101 {
97 register_error(as, l, 1, "Mulitply defined symbol: %s", sym); 102 register_error(as, l, 1, "Mulitply defined symbol: %s", sym);
98 return -1; 103 return -1;
99 } 104 }
102 { 107 {
103 se -> value = val; 108 se -> value = val;
104 if (flags & SYMBOL_COMPLEX) 109 if (flags & SYMBOL_COMPLEX)
105 { 110 {
106 se -> expr = l -> exprs[0]; 111 se -> expr = l -> exprs[0];
112 }
113 else
114 {
115 se -> expr = NULL;
107 } 116 }
108 return; 117 return;
109 } 118 }
110 119
111 // if not a duplicate, register it with the value 120 // if not a duplicate, register it with the value