diff options
author | H. Peter Anvin (Intel) <hpa@zytor.com> | 2018-06-28 02:20:11 -0700 |
---|---|---|
committer | H. Peter Anvin (Intel) <hpa@zytor.com> | 2018-06-28 02:22:55 -0700 |
commit | e8ceba5979c011ee56214944bc68e2dfdc5824f0 (patch) | |
tree | ed0d6e61f5d439dfd9f17acb5f55dabcdb39aa32 | |
parent | 94acb7b5d0774eb4a3eb6a915144553b85104cbf (diff) | |
download | nasm-e8ceba5979c011ee56214944bc68e2dfdc5824f0.tar.gz |
assemble: defer MERR_OPSIZEMISSING
In order for the machinery that deduces memory operand sizes when they
are not provided to work correctly, we need to make sure that
MERR_OPSIZEMISSING is only issued by matches() as the last resort;
that way all other error conditions will have been filtered out and we
know at the very end if we have exactly one option left.
This is a partial revert of cd26fccab48bc35465e68d44a7432d1b1cca4d7e,
but does not affect the functionality introduced by that patch.
Reported-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
-rw-r--r-- | asm/assemble.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/asm/assemble.c b/asm/assemble.c index 7196f911..5dd0d476 100644 --- a/asm/assemble.c +++ b/asm/assemble.c @@ -2170,6 +2170,7 @@ static enum match_result matches(const struct itemplate *itemp, insn *instruction, int bits) { opflags_t size[MAX_OPERANDS], asize; + bool opsizemissing = false; int i, oprs; /* @@ -2347,7 +2348,7 @@ static enum match_result matches(const struct itemplate *itemp, * so "missing operand size" for a register should be * considered a wildcard match rather than an error. */ - return MERR_OPSIZEMISSING; + opsizemissing = true; } } else if (is_broadcast && (brcast_num != @@ -2363,6 +2364,9 @@ static enum match_result matches(const struct itemplate *itemp, } } + if (opsizemissing) + return MERR_OPSIZEMISSING; + /* * Check operand sizes */ |