summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2001-12-27 00:49:47 +0000
committermiod <miod@openbsd.org>2001-12-27 00:49:47 +0000
commitd98386ceb03508199bc6c074b09850d60de67900 (patch)
tree93ebb0dfe65a8af4111f57fa845b2b21e706ae51
parentUnbreak confusion between duplicated, but slightly different, m88k assembler (diff)
downloadwireguard-openbsd-d98386ceb03508199bc6c074b09850d60de67900.tar.xz
wireguard-openbsd-d98386ceb03508199bc6c074b09850d60de67900.zip
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".
-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;