mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-10-10 00:25:06 -04:00
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 cd26fccab4,
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>
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user