Skip to content

Commit

Permalink
disas/nanomips: Tidy read for 48-bit opcodes
Browse files Browse the repository at this point in the history
There is no point in looking for a 48-bit opcode if we've
not read the second word for a 32-bit opcode.

Signed-off-by: Richard Henderson <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <[email protected]>
  • Loading branch information
rth7680 authored and philmd committed Nov 8, 2022
1 parent 1414e3f commit bb3daca
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions disas/nanomips.c
Original file line number Diff line number Diff line change
Expand Up @@ -21964,14 +21964,14 @@ int print_insn_nanomips(bfd_vma memaddr, struct disassemble_info *info)
return -1;
}
length = 4;
}

/* Handle 48-bit opcodes. */
if ((words[0] >> 10) == 0x18) {
if (!read_u16(&words[1], memaddr + 4, info)) {
return -1;
/* Handle 48-bit opcodes. */
if ((words[0] >> 10) == 0x18) {
if (!read_u16(&words[1], memaddr + 4, info)) {
return -1;
}
length = 6;
}
length = 6;
}

for (int i = 0; i < ARRAY_SIZE(words); i++) {
Expand Down

0 comments on commit bb3daca

Please sign in to comment.