From dee334510fe3940456bd282fc9da9ff9257d8483 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Mon, 28 Oct 2019 15:06:32 +0000 Subject: Prevent an illegal memory access in the xgate disassembler. * xgate-dis.c (print_insn): Fix decoding of the XGATE_OP_DYA operand. --- opcodes/xgate-dis.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'opcodes/xgate-dis.c') diff --git a/opcodes/xgate-dis.c b/opcodes/xgate-dis.c index f7ae013212a..ee88bf9c328 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; } -- cgit v1.2.1