diff lwasm/pass4.c @ 142:697bc543368c

Implement distinction between . and * for OS9 modules
author lost@l-w.ca
date Fri, 19 Aug 2011 23:55:40 -0600
parents 2c24602be78f
children 02804b7c051c
line wrap: on
line diff
--- a/lwasm/pass4.c	Fri Aug 19 20:36:43 2011 -0600
+++ b/lwasm/pass4.c	Fri Aug 19 23:55:40 2011 -0600
@@ -56,7 +56,8 @@
 		{
 			as -> cl = sl;
 			lwasm_reduce_expr(as, sl -> addr);
-		
+			lwasm_reduce_expr(as, sl -> daddr);
+	
 			// simplify each expression
 			for (le = sl -> exprs; le; le = le -> next)
 				lwasm_reduce_expr(as, le -> expr);
@@ -65,7 +66,8 @@
 		// simplify address
 		as -> cl = sl;
 		lwasm_reduce_expr(as, sl -> addr);
-		
+		lwasm_reduce_expr(as, sl -> daddr);
+			
 		// simplify each expression
 		for (le = sl -> exprs; le; le = le -> next)
 			lwasm_reduce_expr(as, le -> expr);
@@ -93,7 +95,7 @@
 			
 				// simplify address
 				lwasm_reduce_expr(as, cl -> addr);
-		
+				lwasm_reduce_expr(as, cl -> daddr);
 				// simplify each expression
 				for (le = cl -> exprs; le; le = le -> next)
 					lwasm_reduce_expr(as, le -> expr);
@@ -105,7 +107,14 @@
 					if (cl -> insn >= 0 && instab[cl -> insn].resolve)
 					{
 						(instab[cl -> insn].resolve)(as, cl, 0);
-						if (cl -> len != -1)
+						if ((cl -> inmod == 0) && cl -> len >= 0 && cl -> dlen >= 0)
+						{
+							if (cl -> len == 0)
+								cl -> len = cl -> dlen;
+							else
+								cl -> dlen = cl -> len;
+						}
+						if (cl -> len != -1 && cl -> dlen != -1)
 						{
 							rc++;
 							cnt--;