projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Prevent address violation problem when disassembling corrupt aarch64 binary.
[deliverable/binutils-gdb.git]
/
opcodes
/
rl78-decode.opc
diff --git
a/opcodes/rl78-decode.opc
b/opcodes/rl78-decode.opc
index 6e849598ed1a0e7f814dbab33f0c8168e3e1bb0e..b25e4410a8625149f02f4193aec7734983313341 100644
(file)
--- a/
opcodes/rl78-decode.opc
+++ b/
opcodes/rl78-decode.opc
@@
-1,5
+1,5
@@
/* -*- c -*- */
/* -*- c -*- */
-/* Copyright (C) 2012-201
5
Free Software Foundation, Inc.
+/* Copyright (C) 2012-201
7
Free Software Foundation, Inc.
Contributed by Red Hat.
Written by DJ Delorie.
Contributed by Red Hat.
Written by DJ Delorie.
@@
-50,7
+50,9
@@
typedef struct
#define W() rl78->size = RL78_Word
#define AU ATTRIBUTE_UNUSED
#define W() rl78->size = RL78_Word
#define AU ATTRIBUTE_UNUSED
-#define GETBYTE() (ld->op [ld->rl78->n_bytes++] = ld->getbyte (ld->ptr))
+
+#define OP_BUF_LEN 20
+#define GETBYTE() (ld->rl78->n_bytes < (OP_BUF_LEN - 1) ? ld->op [ld->rl78->n_bytes++] = ld->getbyte (ld->ptr): 0)
#define B ((unsigned long) GETBYTE())
#define SYNTAX(x) rl78->syntax = x
#define B ((unsigned long) GETBYTE())
#define SYNTAX(x) rl78->syntax = x
@@
-168,7
+170,7
@@
rl78_decode_opcode (unsigned long pc AU,
RL78_Dis_Isa isa)
{
LocalData lds, * ld = &lds;
RL78_Dis_Isa isa)
{
LocalData lds, * ld = &lds;
- unsigned char op_buf[
20
] = {0};
+ unsigned char op_buf[
OP_BUF_LEN
] = {0};
unsigned char *op = op_buf;
int op0, op1;
unsigned char *op = op_buf;
int op0, op1;
@@
-882,7
+884,7
@@
rl78_decode_opcode (unsigned long pc AU,
/** 1010 1110 movw %0, %s1 */
ID(mov); W(); DR(AX); SM(None, SFR);
/** 1010 1110 movw %0, %s1 */
ID(mov); W(); DR(AX); SM(None, SFR);
-/** 11ra 1011 movw %0, %e
!1
*/
+/** 11ra 1011 movw %0, %e
s!1
*/
ID(mov); W(); DRW(ra); SM(None, IMMU(2));
/** 11ra 1010 movw %0, %1 */
ID(mov); W(); DRW(ra); SM(None, IMMU(2));
/** 11ra 1010 movw %0, %1 */
@@
-903,8
+905,7
@@
rl78_decode_opcode (unsigned long pc AU,
/*----------------------------------------------------------------------*/
/** 1101 0110 mulu x */
/*----------------------------------------------------------------------*/
/** 1101 0110 mulu x */
- if (isa == RL78_ISA_G14)
- ID(mulu);
+ ID(mulu);
/*----------------------------------------------------------------------*/
/*----------------------------------------------------------------------*/
This page took
0.024399 seconds
and
4
git commands to generate.