Factor out size tokens and annotate with the corresponding size
There is space in the token table to explicitly encode the size
corresponding to a size token. We might as well do so...
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
diff --git a/asm/parser.c b/asm/parser.c
index c76696c..9349e25 100644
--- a/asm/parser.c
+++ b/asm/parser.c
@@ -767,7 +767,8 @@
}
first = false;
op->type = 0; /* so far, no override */
- while (i == TOKEN_SPECIAL) { /* size specifiers */
+ /* size specifiers */
+ while (i == TOKEN_SPECIAL || i == TOKEN_SIZE) {
switch (tokval.t_integer) {
case S_BYTE:
if (!setsize) /* we want to use only the first */
@@ -835,7 +836,8 @@
mref = true;
bracket = (i == '[');
i = stdscan(NULL, &tokval); /* then skip the colon */
- while (i == TOKEN_SPECIAL || i == TOKEN_PREFIX) {
+ while (i == TOKEN_SPECIAL || i == TOKEN_SIZE ||
+ i == TOKEN_PREFIX) {
process_size_override(result, op);
i = stdscan(NULL, &tokval);
}
@@ -880,7 +882,8 @@
}
i = stdscan(NULL, &tokval); /* then skip the colon */
- while (i == TOKEN_SPECIAL || i == TOKEN_PREFIX) {
+ while (i == TOKEN_SPECIAL || i == TOKEN_SIZE ||
+ i == TOKEN_PREFIX) {
process_size_override(result, op);
i = stdscan(NULL, &tokval);
}