aboutsummaryrefslogtreecommitdiff
path: root/opcodes/xgate-dis.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2019-10-28 15:06:32 +0000
committerNick Clifton <nickc@redhat.com>2019-10-28 15:06:32 +0000
commitdee334510fe3940456bd282fc9da9ff9257d8483 (patch)
tree7c9b60ea86d49e14bcee229e9cefc4c946a1d0de /opcodes/xgate-dis.c
parent12c3e9173ee19b0479b3d51c6cf192542e9c7ae9 (diff)
downloadgdb-dee334510fe3940456bd282fc9da9ff9257d8483.zip
gdb-dee334510fe3940456bd282fc9da9ff9257d8483.tar.gz
gdb-dee334510fe3940456bd282fc9da9ff9257d8483.tar.bz2
Prevent an illegal memory access in the xgate disassembler.
* xgate-dis.c (print_insn): Fix decoding of the XGATE_OP_DYA operand.
Diffstat (limited to 'opcodes/xgate-dis.c')
-rw-r--r--opcodes/xgate-dis.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/opcodes/xgate-dis.c b/opcodes/xgate-dis.c
index f7ae013..ee88bf9 100644
--- a/opcodes/xgate-dis.c
+++ b/opcodes/xgate-dis.c
@@ -169,8 +169,8 @@ print_insn (bfd_vma memaddr, struct disassemble_info* info)
}
else if (!strcmp (decodePTR->opcodePTR->constraints, XGATE_OP_DYA))
{
- operandOne = ripBits (&operMaskReg, 3, opcodePTR, raw_code);
- operandTwo = ripBits (&operMaskReg, 3, opcodePTR, raw_code);
+ operandOne = ripBits (&operMaskReg, 3, decodePTR->opcodePTR, raw_code);
+ operandTwo = ripBits (&operMaskReg, 3, decodePTR->opcodePTR, raw_code);
( *info->fprintf_func)(info->stream, " R%x, R%x", operandOne,
operandTwo);
}
@@ -259,7 +259,7 @@ print_insn (bfd_vma memaddr, struct disassemble_info* info)
else
{
(*info->fprintf_func)(info->stream, " unhandled mode %s",
- opcodePTR->constraints);
+ decodePTR->opcodePTR->constraints);
}
perviousBin = raw_code;
}