diff lwasm/parse.c @ 223:436b36214e35

Fixed lack of error when there are extraneous characters at the end of the operand.
author lost
date Mon, 11 May 2009 06:09:49 +0000
parents bae1e3ecdce1
children 0df2a39a268c
line wrap: on
line diff
--- a/lwasm/parse.c	Sat May 09 16:39:17 2009 +0000
+++ b/lwasm/parse.c	Mon May 11 06:09:49 2009 +0000
@@ -184,6 +184,10 @@
 		if (instab[opnum].fn)
 		{
 			(instab[opnum].fn)(as, l, &p2, opnum);
+			
+			// if we didn't end on a "space" character or EOL, throw error
+			if (*p2 && !isspace(*p2))
+				register_error(as, l, 1, "Bad operand");
 		}
 		else
 		{