Fix potential undefined behaviour in the RX disassembler.

* rx-dis.c (print_insn_rx): Use parenthesis to ensure correct
	access to opcodes.op array element.
This commit is contained in:
Nick Clifton 2019-10-25 16:10:04 +01:00
parent 93878f4717
commit 27cee81d06
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2019-10-25 Nick Clifton <nickc@redhat.com>
* rx-dis.c (print_insn_rx): Use parenthesis to ensure correct
access to opcodes.op array element.
2019-10-23 Nick Clifton <nickc@redhat.com>
* rx-dis.c (get_register_name): Fix spelling typo in error

View File

@ -319,7 +319,7 @@ print_insn_rx (bfd_vma addr, disassemble_info * dis)
case '0':
case '1':
case '2':
oper = opcode.op + *s - '0';
oper = opcode.op + (*s - '0');
if (do_size)
{
if (oper->type == RX_Operand_Indirect || oper->type == RX_Operand_Zero_Indirect)