diff options
Diffstat (limited to 'opcodes/ia64-opc.c')
-rw-r--r-- | opcodes/ia64-opc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/opcodes/ia64-opc.c b/opcodes/ia64-opc.c index b6e95f1..5aa1198 100644 --- a/opcodes/ia64-opc.c +++ b/opcodes/ia64-opc.c @@ -123,7 +123,7 @@ static short find_main_ent (short nameindex) { short start = 0; - short end = sizeof (main_table) / sizeof (struct ia64_main_table); + short end = ARRAY_SIZE (main_table); short i = (start + end) / 2; if (nameindex < main_table[0].name_index @@ -612,6 +612,9 @@ ia64_find_matching_opcode (const char *name, short place) const char *suffix; short name_index; + if ((unsigned) place >= ARRAY_SIZE (main_table)) + return NULL; + if (strlen (name) > 128) { return NULL; |