summaryrefslogtreecommitdiff
path: root/assemble.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-09-12 20:27:41 -0700
committerH. Peter Anvin <hpa@zytor.com>2007-09-12 20:27:41 -0700
commit16b0a33ceae7b57cf4ebc9ab62cd4e1dc00dbf8c (patch)
tree8402b87bfea53a1b9c57069653c3b8f42e0f8b6e /assemble.c
parent7978feebd2fb0be9f4a37980090dfebeeb29a36d (diff)
downloadnasm-16b0a33ceae7b57cf4ebc9ab62cd4e1dc00dbf8c.tar.gz
Use enumerations where practical to ease debugging
We have a lot of enumerations; by declaring fields as such, we make it easier when debugging, since the debugger can display the enumerations in cleartext. However, make sure exceptional values (like -1) are included in the enumeration, since the compiler otherwise may not include it in the valid range of the enumeration.
Diffstat (limited to 'assemble.c')
-rw-r--r--assemble.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/assemble.c b/assemble.c
index 417bb2d8..9288aab9 100644
--- a/assemble.c
+++ b/assemble.c
@@ -246,6 +246,8 @@ int32_t assemble(int32_t segment, int32_t offset, int bits, uint32_t cp,
case I_DT:
wsize = 10;
break;
+ default:
+ break;
}
if (wsize) {
@@ -582,6 +584,8 @@ int32_t insn_size(int32_t segment, int32_t offset, int bits, uint32_t cp,
case I_DT:
wsize = 10;
break;
+ default:
+ break;
}
for (e = instruction->eops; e; e = e->next) {
@@ -1554,7 +1558,7 @@ static int matches(const struct itemplate *itemp, insn * instruction, int bits)
/*
* Check that the operand flags all match up
*/
- for (i = 0; i < itemp->operands; i++)
+ for (i = 0; i < itemp->operands; i++) {
if (itemp->opd[i] & ~instruction->oprs[i].type ||
((itemp->opd[i] & SIZE_MASK) &&
((itemp->opd[i] ^ instruction->oprs[i].type) & SIZE_MASK))) {
@@ -1564,6 +1568,7 @@ static int matches(const struct itemplate *itemp, insn * instruction, int bits)
else
return 1;
}
+ }
/*
* Check operand sizes