changeset 160:02804b7c051c

Don't error out on dlen set and len not for insn length resolution
author lost@l-w.ca
date Sun, 28 Aug 2011 14:17:33 -0600
parents 8967eb907324
children 409295d09a2e
files lwasm/pass4.c lwasm/pass6.c
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lwasm/pass4.c	Sun Aug 28 14:16:45 2011 -0600
+++ b/lwasm/pass4.c	Sun Aug 28 14:17:33 2011 -0600
@@ -76,7 +76,7 @@
 		if (sl -> len == -1 && sl -> insn >= 0 && instab[sl -> insn].resolve)
 		{
 			(instab[sl -> insn].resolve)(as, sl, 1);
-			if (force && sl -> len == -1)
+			if (force && sl -> len == -1 && sl -> dlen == -1)
 			{
 				lwasm_register_error(as, sl, "Instruction failed to resolve.");
 				return;
--- a/lwasm/pass6.c	Sun Aug 28 14:16:45 2011 -0600
+++ b/lwasm/pass6.c	Sun Aug 28 14:17:33 2011 -0600
@@ -83,7 +83,7 @@
 			lwasm_reduce_expr(as, le -> expr);
 			if (!exprok(as, le -> expr))
 			{
-				lwasm_register_error(as, cl, "Invalid expression");
+				lwasm_register_error(as, cl, "Invalid expression: %s", lw_expr_print(le -> expr));
 			}
 		}
 	}