summaryrefslogtreecommitdiff
path: root/assemble.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-07-25 19:12:10 -0700
committerH. Peter Anvin <hpa@zytor.com>2009-07-25 19:12:10 -0700
commit3fb86f2cd650445c3fca877d00752050bd003ded (patch)
tree89c06f9e944eec7f942a0e897c4fd24ca3b74d27 /assemble.c
parenta81655bffb3841a0326c7224403f8c8e7cccd82a (diff)
downloadnasm-3fb86f2cd650445c3fca877d00752050bd003ded.tar.gz
nasm-3fb86f2cd650445c3fca877d00752050bd003ded.tar.bz2
nasm-3fb86f2cd650445c3fca877d00752050bd003ded.zip
assemble: defer "operand size missing" until end of type check
Defer the "operand size missing" error until we know all the other operands have the correct type. Otherwise we'll end up with false positives, which result in noise entered into the xsizeflags array, thus causing fuzzy matching to fail. It's possible we should defer it even further. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'assemble.c')
-rw-r--r--assemble.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/assemble.c b/assemble.c
index 829cb1b..b4ba444 100644
--- a/assemble.c
+++ b/assemble.c
@@ -2053,6 +2053,7 @@ static enum match_result matches(const struct itemplate *itemp,
insn *instruction, int bits)
{
int i, size[MAX_OPERANDS], asize, oprs, ret;
+ bool opsizemissing = false;
ret = MOK_GOOD;
@@ -2178,10 +2179,13 @@ static enum match_result matches(const struct itemplate *itemp,
if ((itemp->opd[i] & ~type & ~SIZE_MASK) || (type & SIZE_MASK))
return MERR_INVALOP;
else
- return MERR_OPSIZEMISSING;
+ opsizemissing = true;
}
}
+ if (opsizemissing)
+ return MERR_OPSIZEMISSING;
+
/*
* Check operand sizes
*/