projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
metag uninitialized memory read
[deliverable/binutils-gdb.git]
/
opcodes
/
ia64-opc.c
diff --git
a/opcodes/ia64-opc.c
b/opcodes/ia64-opc.c
index 49a8ffdab9bfca0a28a04bc02b4acdfd3cb1c340..cebf52356ee643c921d2247f38de975defed1445 100644
(file)
--- a/
opcodes/ia64-opc.c
+++ b/
opcodes/ia64-opc.c
@@
-1,5
+1,5
@@
/* ia64-opc.c -- Functions to access the compacted opcode table
/* ia64-opc.c -- Functions to access the compacted opcode table
- Copyright (C) 1999-20
16
Free Software Foundation, Inc.
+ Copyright (C) 1999-20
20
Free Software Foundation, Inc.
Written by Bob Manson of Cygnus Solutions, <manson@cygnus.com>
This file is part of the GNU opcodes library.
Written by Bob Manson of Cygnus Solutions, <manson@cygnus.com>
This file is part of the GNU opcodes library.
@@
-123,7
+123,7
@@
static short
find_main_ent (short nameindex)
{
short start = 0;
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
short i = (start + end) / 2;
if (nameindex < main_table[0].name_index
@@
-372,13
+372,16
@@
locate_opcode_ent (ia64_insn opcode, enum ia64_insn_type type)
bitpos[currstatenum] = currbitnum;
bitpos[currstatenum] = currbitnum;
- /* Skip opval[0] bits in the instruction. */
+ /* Skip opval[0] bits in the instruction.
*/
if (op & 0x40)
{
currbitnum -= opval[0];
}
if (op & 0x40)
{
currbitnum -= opval[0];
}
- /* The value of the current bit being tested. */
+ if (currbitnum < 0)
+ currbitnum = 0;
+
+ /* The value of the current bit being tested. */
currbit = opcode & (((ia64_insn) 1) << currbitnum) ? 1 : 0;
next_op = -1;
currbit = opcode & (((ia64_insn) 1) << currbitnum) ? 1 : 0;
next_op = -1;
@@
-463,7
+466,7
@@
locate_opcode_ent (ia64_insn opcode, enum ia64_insn_type type)
if (next_op > 65535)
{
if (next_op > 65535)
{
-
abort ()
;
+
return -1
;
}
/* Run through the list of opcodes to check, trying to find
}
/* Run through the list of opcodes to check, trying to find
@@
-612,6
+615,9
@@
ia64_find_matching_opcode (const char *name, short place)
const char *suffix;
short name_index;
const char *suffix;
short name_index;
+ if ((unsigned) place >= ARRAY_SIZE (main_table))
+ return NULL;
+
if (strlen (name) > 128)
{
return NULL;
if (strlen (name) > 128)
{
return NULL;
This page took
0.025115 seconds
and
4
git commands to generate.