summaryrefslogtreecommitdiff
path: root/opcodes/cgen-asm.c
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@nildram.co.uk>2001-11-09 18:05:30 +0000
committerRichard Sandiford <rsandifo@nildram.co.uk>2001-11-09 18:05:30 +0000
commit16da2f670ffb479cf0c7a0adf297881495dd67f3 (patch)
treec9572933e979c2202c3798210b9906cf2cc681a0 /opcodes/cgen-asm.c
parent8f7c482439e7d35376622b98d93331af5cb2fe93 (diff)
downloadbinutils-redhat-16da2f670ffb479cf0c7a0adf297881495dd67f3.tar.gz
* cgen-asm.c (cgen_parse_keyword): If the keyword is too big to
fit in the buffer, try to match the empty keyword.
Diffstat (limited to 'opcodes/cgen-asm.c')
-rw-r--r--opcodes/cgen-asm.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/opcodes/cgen-asm.c b/opcodes/cgen-asm.c
index b664d7bc8b..05b62bf49e 100644
--- a/opcodes/cgen-asm.c
+++ b/opcodes/cgen-asm.c
@@ -229,10 +229,16 @@ cgen_parse_keyword (cd, strp, keyword_table, valuep)
++p;
if (p - start >= (int) sizeof (buf))
- return _("unrecognized keyword/register name");
-
- memcpy (buf, start, p - start);
- buf[p - start] = 0;
+ {
+ /* All non-empty CGEN keywords can fit into BUF. The only thing
+ we can match here is the empty keyword. */
+ buf[0] = 0;
+ }
+ else
+ {
+ memcpy (buf, start, p - start);
+ buf[p - start] = 0;
+ }
ke = cgen_keyword_lookup_name (keyword_table, buf);