This bug reported in
https://sourceware.org/bugzilla/show_bug.cgi?id=30184
And discussed in
https://sourceware.org/pipermail/binutils/2023-February/126213.html
We also checked the implementation of return value in arm and mips.
So this patch changes the return value to -1, that can fix bugs and maintain
consistency with other architectures.
opcodes/ChangeLog:
* riscv-dis.c (print_insn_riscv):Change the return value.
if (status != 0)
{
(*info->memory_error_func) (status, memaddr, info);
- return status;
+ return -1;
}
insn = (insn_t) bfd_getl16 (packet);
dump_size = riscv_insn_length (insn);
if (status != 0)
{
(*info->memory_error_func) (status, memaddr, info);
- return status;
+ return -1;
}
insn = (insn_t) bfd_get_bits (packet, dump_size * 8, false);