summaryrefslogtreecommitdiff
path: root/assemble.c
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2009-10-13 19:05:31 +0400
committerCyrill Gorcunov <gorcunov@gmail.com>2009-10-13 19:41:49 +0400
commit8a6345ca47af16f8657e55282e1c84e4b8e4e96b (patch)
treeff7afed553fd403466061ed18634ea8cdf976baa /assemble.c
parent1985416b0ba9e482404b3804977a745c791ab672 (diff)
downloadnasm-8a6345ca47af16f8657e55282e1c84e4b8e4e96b.tar.gz
assemble.c: use is_class helper
is_class does not checking flags "strictly". Which means it may fail if type is specified to REGMEM and you check for is_class(MEMORY, ...). Anyway in current patch we check for REGISTER which doesn't overlap and it is safe to use is_class here. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'assemble.c')
-rw-r--r--assemble.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/assemble.c b/assemble.c
index e948ee36..78235390 100644
--- a/assemble.c
+++ b/assemble.c
@@ -2027,7 +2027,7 @@ static enum match_result find_match(const struct itemplate **tempp,
* never try to fuzzy-match on them. This also resolves the case
* when we have e.g. "xmmrm128" in two different positions.
*/
- if ((REGISTER & ~instruction->oprs[i].type) == 0)
+ if (is_class(REGISTER, instruction->oprs[i].type))
continue;
/* This tests if xsizeflags[i] has more than one bit set */
@@ -2155,7 +2155,7 @@ static enum match_result matches(const struct itemplate *itemp,
((itemp->opd[i] ^ type) & SIZE_MASK))) {
if ((itemp->opd[i] & ~type & ~SIZE_MASK) || (type & SIZE_MASK)) {
return MERR_INVALOP;
- } else if ((REGISTER & type) != REGISTER) {
+ } else if (!is_class(REGISTER, type)) {
/*
* Note: we don't honor extrinsic operand sizes for registers,
* so "missing operand size" for a register should be
@@ -2224,7 +2224,7 @@ static ea *process_ea(operand * input, ea * output, int bits,
/* REX flags for the rfield operand */
output->rex |= rexflags(rfield, rflags, REX_R|REX_P|REX_W|REX_H);
- if (!(REGISTER & ~input->type)) { /* register direct */
+ if (is_class(REGISTER, input->type)) { /* register direct */
int i;
int32_t f;