# HG changeset patch # User lost # Date 1242022189 0 # Node ID 436b36214e35e40f6d500483de57c7e6ad035c61 # Parent 7803d2d099936fc1d6112bb2b08557af86009229 Fixed lack of error when there are extraneous characters at the end of the operand. diff -r 7803d2d09993 -r 436b36214e35 ChangeLog --- a/ChangeLog Sat May 09 16:39:17 2009 +0000 +++ b/ChangeLog Mon May 11 06:09:49 2009 +0000 @@ -17,6 +17,9 @@ generated by lwasm [LWASM] [b] Fixed segfault in "extern" pseudo op and allowed a symbol list as the operand just like "export" [LWASM] +[b] Fixed lack of error when there are extraneous characters at the end + of the operand. This did not cause incorrect code generation for correct + code but would silently generate incorrect code for some easy errors [+] 8 bit immediate operands can now be external references [LWASM] Version 2.3 diff -r 7803d2d09993 -r 436b36214e35 lwasm/parse.c --- 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 {