diff 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
line wrap: on
line diff
--- a/src/symbol.c	Sat Jan 10 05:00:42 2009 +0000
+++ b/src/symbol.c	Sat Jan 10 07:09:14 2009 +0000
@@ -92,6 +92,11 @@
 	se = lwasm_find_symbol(as, sym, scontext);
 	if (se)
 	{
+		if (flags & SYMBOL_FORCE && as -> passnum != 2)
+		{
+			register_error(as, l, 1, "Multiply defined symbol: %s", sym);
+			return -1;
+		}
 		if (!(flags & SYMBOL_SET) || (flags & SYMBOL_SET && !(se -> flags & SYMBOL_SET)))
 		{
 			register_error(as, l, 1, "Mulitply defined symbol: %s", sym);
@@ -105,6 +110,10 @@
 		{
 			se -> expr = l -> exprs[0];
 		}
+		else
+		{
+			se -> expr = NULL;
+		}
 		return;
 	}