aboutsummaryrefslogtreecommitdiff
path: root/opcodes/rx-dis.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2019-10-25 16:10:04 +0100
committerNick Clifton <nickc@redhat.com>2019-10-25 16:10:04 +0100
commit27cee81d06fcff87d9c026a571db58c29c489dfa (patch)
treedd53da0f69ab64a69649cacac18543b6ade5d083 /opcodes/rx-dis.c
parent93878f471745364756b9bad753c5052614fbcd7e (diff)
downloadbinutils-27cee81d06fcff87d9c026a571db58c29c489dfa.zip
binutils-27cee81d06fcff87d9c026a571db58c29c489dfa.tar.gz
binutils-27cee81d06fcff87d9c026a571db58c29c489dfa.tar.bz2
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.
Diffstat (limited to 'opcodes/rx-dis.c')
-rw-r--r--opcodes/rx-dis.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/opcodes/rx-dis.c b/opcodes/rx-dis.c
index c84f7c5..80144bb 100644
--- a/opcodes/rx-dis.c
+++ b/opcodes/rx-dis.c
@@ -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)