diff options
author | Nick Clifton <nickc@redhat.com> | 2002-09-13 09:16:02 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2002-09-13 09:16:02 +0000 |
commit | 7fe9cf6bf650c675da056a2e6cef9631440535be (patch) | |
tree | bfe8f6f2f8cfc5b87856b3f948587bad1be9ee83 /gas/config | |
parent | dde1b132235157e055ae3ca4232e63b08775b862 (diff) | |
download | gdb-7fe9cf6bf650c675da056a2e6cef9631440535be.zip gdb-7fe9cf6bf650c675da056a2e6cef9631440535be.tar.gz gdb-7fe9cf6bf650c675da056a2e6cef9631440535be.tar.bz2 |
Do not count FAKE operands when deciding if any operands have been skipped.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-ppc.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c index 613a61a..8f89c77 100644 --- a/gas/config/tc-ppc.c +++ b/gas/config/tc-ppc.c @@ -2069,6 +2069,8 @@ md_assemble (str) if ((operand->flags & PPC_OPERAND_OPTIONAL) != 0) { unsigned int opcount; + unsigned int num_operands_expected; + unsigned int i; /* There is an optional operand. Count the number of commas in the input line. */ @@ -2085,10 +2087,16 @@ md_assemble (str) } } + /* Compute the number of expected operands. + Do not count fake operands. */ + for (num_operands_expected = 0, i = 0; opcode->operands[i]; i ++) + if ((powerpc_operands [opcode->operands[i]].flags & PPC_OPERAND_FAKE) == 0) + ++ num_operands_expected; + /* If there are fewer operands in the line then are called for by the instruction, we want to skip the optional operand. */ - if (opcount < strlen (opcode->operands)) + if (opcount < num_operands_expected) skip_optional = 1; break; |