changeset 147:9cf1796259b2

Fixed segfault in fcb,fdb,fqb with empty operands
author lost@l-w.ca
date Thu, 25 Aug 2011 22:29:58 -0600
parents f5b8559a5f35
children 08fb11004df9
files lwasm/pass1.c lwasm/pseudo.c
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lwasm/pass1.c	Wed Aug 24 21:16:17 2011 -0600
+++ b/lwasm/pass1.c	Thu Aug 25 22:29:58 2011 -0600
@@ -339,7 +339,7 @@
 								cl -> dlen = cl -> len;
 						}
 					
-						if (*p1 && !isspace(*p1))
+						if (*p1 && !isspace(*p1) && !(cl -> err))
 						{
 							// flag bad operand error
 							lwasm_register_error(as, cl, "Bad operand (%s)", p1);
--- a/lwasm/pseudo.c	Wed Aug 24 21:16:17 2011 -0600
+++ b/lwasm/pseudo.c	Thu Aug 25 22:29:58 2011 -0600
@@ -138,7 +138,7 @@
 		e = lwasm_parse_expr(as, p);
 		if (!e)
 		{
-			lwasm_register_error(as, l, "Bad expression (#%s)", i);
+			lwasm_register_error(as, l, "Bad expression (#%d)", i);
 			break;
 		}
 		lwasm_save_expr(l, i++, e);
@@ -208,7 +208,7 @@
 		e = lwasm_parse_expr(as, p);
 		if (!e)
 		{
-			lwasm_register_error(as, l, "Bad expression (#%s)", i);
+			lwasm_register_error(as, l, "Bad expression (#%d)", i);
 			break;
 		}
 		lwasm_save_expr(l, i++, e);