summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/gas
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2001-12-27 00:49:48 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2001-12-27 00:49:48 +0000
commit47f1b7ec4b812dbdc3775d7664c70f817dabb31a (patch)
tree49b1b6e877985d6e635e8d5fd8491b3f325b327b /gnu/usr.bin/gas
parent582503d4e2172f1a0bb6e89cdc9c2da80681ab86 (diff)
Fix the brain-dead assembler to correctly handle opcodes which have no
arguments (such as rte) but do not appear exactly at the end of a line (i.e. whitespace follows) instead of reporting (incorrectly) "parameter syntax error".
Diffstat (limited to 'gnu/usr.bin/gas')
-rw-r--r--gnu/usr.bin/gas/config/tc-m88k.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/gnu/usr.bin/gas/config/tc-m88k.c b/gnu/usr.bin/gas/config/tc-m88k.c
index 47615fdfc06..8d04ddd95e2 100644
--- a/gnu/usr.bin/gas/config/tc-m88k.c
+++ b/gnu/usr.bin/gas/config/tc-m88k.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tc-m88k.c,v 1.4 2001/12/27 00:23:27 miod Exp $ */
+/* $OpenBSD: tc-m88k.c,v 1.5 2001/12/27 00:49:47 miod Exp $ */
/* m88k.c -- Assembler for the Motorola 88000
Contributed by Devon Bowen of Buffalo University
@@ -377,10 +377,23 @@ calcop (format, param, insn)
insn->opcode = format->opcode;
opcode = 0;
+ /*
+ * Instructions which have no arguments (such as rte) will get
+ * correctly reported only if param == "", although there could be
+ * whitespace following the instruction.
+ * Rather than eating whitespace here, let's assume everything is
+ * fine. If there were non-wanted arguments, this will be parsed as
+ * an incorrect opcode at the offending line, so that's not too bad.
+ * -- miod
+ */
+ if (*fmt == '\0')
+ return 1;
+
for (;;)
{
if (param == 0)
return 0;
+
f = *fmt++;
switch (f)
{
@@ -456,7 +469,7 @@ calcop (format, param, insn)
break;
case '?':
- /* Having this here repeats the warning somtimes.
+ /* Having this here repeats the warning sometimes.
But can't we stand that? */
as_warn ("Use of obsolete instruction");
break;