aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2001-11-09 18:05:30 +0000
committerRichard Sandiford <rdsandiford@googlemail.com>2001-11-09 18:05:30 +0000
commitb165b83891be5218d0f7b4c9e773c5fb4b6d8e6e (patch)
treef92e396b5c3c4b22d275e3db9c9761261266ea6a
parentf312f057407f275b27753c401ede0938c45d299c (diff)
downloadgdb-b165b83891be5218d0f7b4c9e773c5fb4b6d8e6e.zip
gdb-b165b83891be5218d0f7b4c9e773c5fb4b6d8e6e.tar.gz
gdb-b165b83891be5218d0f7b4c9e773c5fb4b6d8e6e.tar.bz2
* cgen-asm.c (cgen_parse_keyword): If the keyword is too big to
fit in the buffer, try to match the empty keyword.
-rw-r--r--opcodes/ChangeLog5
-rw-r--r--opcodes/cgen-asm.c14
2 files changed, 15 insertions, 4 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index a319183..b064120 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,8 @@
+2001-11-09 Richard Sandiford <rsandifo@redhat.com>
+
+ * cgen-asm.c (cgen_parse_keyword): If the keyword is too big to
+ fit in the buffer, try to match the empty keyword.
+
2001-11-09 Nick Clifton <nickc@cambridge.redhat.com>
* cgen-ibld.in (extract_1): Fix badly placed #if 0.
diff --git a/opcodes/cgen-asm.c b/opcodes/cgen-asm.c
index b664d7b..05b62bf 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);