public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Nelson Chu <nelson@rivosinc.com>
To: Jiawei <jiawei@iscas.ac.cn>
Cc: binutils@sourceware.org, palmer@dabbelt.com,
	christoph.muellner@vrull.eu,  wuwei2016@iscas.ac.cn
Subject: Re: [PATCH] RISC-V: Adjust the 'print_insn' return value of disassembling.
Date: Fri, 17 Mar 2023 10:26:21 +0800	[thread overview]
Message-ID: <CAPpQWtBJeyTnka9vntGHr5zZ12Xd_rLTHa9YWLpD5CZsBePSyw@mail.gmail.com> (raw)
In-Reply-To: <20230317015323.567132-1-jiawei@iscas.ac.cn>

OK, looks reasonable and good, please commit.

Thanks
Nelson

On Fri, Mar 17, 2023 at 9:54 AM Jiawei <jiawei@iscas.ac.cn> wrote:
>
> 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.
>
> ---
>  opcodes/riscv-dis.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/opcodes/riscv-dis.c b/opcodes/riscv-dis.c
> index 7baba054daa..1506dc5750b 100644
> --- a/opcodes/riscv-dis.c
> +++ b/opcodes/riscv-dis.c
> @@ -1059,7 +1059,7 @@ print_insn_riscv (bfd_vma memaddr, struct disassemble_info *info)
>        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);
> --
> 2.25.1
>

  reply	other threads:[~2023-03-17  2:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-17  1:53 Jiawei
2023-03-17  2:26 ` Nelson Chu [this message]
2023-03-18  4:41 Xiaolin Zheng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPpQWtBJeyTnka9vntGHr5zZ12Xd_rLTHa9YWLpD5CZsBePSyw@mail.gmail.com \
    --to=nelson@rivosinc.com \
    --cc=binutils@sourceware.org \
    --cc=christoph.muellner@vrull.eu \
    --cc=jiawei@iscas.ac.cn \
    --cc=palmer@dabbelt.com \
    --cc=wuwei2016@iscas.ac.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).