qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Max Filippov <jcmvbkbc@gmail.com>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
	Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH v2 16/16] target/xtensa: implement disassembler
Date: Thu, 18 Jan 2018 13:34:07 +0000	[thread overview]
Message-ID: <CAFEAcA9nZL+aTSRsjzweZm=mZh5-QAUS2y0CGeC-auRfhe3EvA@mail.gmail.com> (raw)
In-Reply-To: <1513661932-6849-17-git-send-email-jcmvbkbc@gmail.com>

On 19 December 2017 at 05:38, Max Filippov <jcmvbkbc@gmail.com> wrote:
> Add disas/xtensa.c and use libisa for instruction decoding/opcode name
> lookup.
>
> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>

> +    slots = xtensa_format_num_slots(isa, fmt);
> +
> +    if (slots > 1) {
> +        info->fprintf_func(info->stream, "{ ");
> +    }
> +
> +    for (slot = 0; slot < slots; ++slot) {
> +        xtensa_opcode opc;
> +        unsigned opnd, vopnd, opnds;
> +
> +        if (slot) {
> +            info->fprintf_func(info->stream, "; ");
> +        }
> +        xtensa_format_get_slot(isa, fmt, slot, insnbuf, slotbuf);
> +        opc = xtensa_opcode_decode(isa, fmt, slot, slotbuf);
> +        if (opc == XTENSA_UNDEFINED) {
> +            info->fprintf_func(info->stream, "???");
> +            continue;
> +        }
> +        opnds = xtensa_opcode_num_operands(isa, opc);
> +
> +        info->fprintf_func(info->stream, "%s", xtensa_opcode_name(isa, opc));
> +
> +        for (opnd = vopnd = 0; opnd < opnds; ++opnd) {

Hi. Coverity complains here as well (CID 1385149, 1385150)
that the loop bound may be negative if xtensa_format_num_slots() or
xtensa_opcode_num_operands() return -1.


thanks
-- PMM

  reply	other threads:[~2018-01-18 13:34 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-19  5:38 [Qemu-devel] [PATCH v2 00/16] target/xtensa: switch to libisa Max Filippov
2017-12-19  5:38 ` [Qemu-devel] [PATCH v2 01/16] target/xtensa: pass actual frame size to the entry helper Max Filippov
2017-12-19  5:38 ` [Qemu-devel] [PATCH v2 02/16] target/xtensa: import libisa source Max Filippov
2017-12-19  5:38 ` [Qemu-devel] [PATCH v2 03/16] target/xtensa: extract core opcode translators Max Filippov
2017-12-19  5:38 ` [Qemu-devel] [PATCH v2 04/16] target/xtensa: extract FPU2000 " Max Filippov
2017-12-19  5:38 ` [Qemu-devel] [PATCH v2 05/16] target/xtensa: update import_core.sh script for libisa Max Filippov
2017-12-19  5:38 ` [Qemu-devel] [PATCH v2 06/16] target/xtensa: switch dc232b to libisa Max Filippov
2017-12-19  5:38 ` [Qemu-devel] [PATCH v2 07/16] target/xtensa: switch dc233c " Max Filippov
2017-12-19  5:38 ` [Qemu-devel] [PATCH v2 08/16] target/xtensa: switch fsf " Max Filippov
2017-12-19  5:38 ` [Qemu-devel] [PATCH v2 09/16] target/xtensa: use libisa for instruction decoding Max Filippov
2017-12-19  5:38 ` [Qemu-devel] [PATCH v2 10/16] target/xtensa: tests: fix memctl SR test Max Filippov
2017-12-19  5:38 ` [Qemu-devel] [PATCH v2 11/16] target/xtensa: drop DisasContext::litbase Max Filippov
2017-12-19  5:38 ` [Qemu-devel] [PATCH v2 12/16] target/xtensa: add internal/noop SRs and opcodes Max Filippov
2017-12-19  5:38 ` [Qemu-devel] [PATCH v2 13/16] target/xtensa: implement salt/saltu Max Filippov
2017-12-19  5:38 ` [Qemu-devel] [PATCH v2 14/16] target/xtensa: implement GPIO32 Max Filippov
2017-12-19  5:38 ` [Qemu-devel] [PATCH v2 15/16] target/xtensa: implement const16 Max Filippov
2017-12-19  5:38 ` [Qemu-devel] [PATCH v2 16/16] target/xtensa: implement disassembler Max Filippov
2018-01-18 13:34   ` Peter Maydell [this message]
2017-12-19  6:14 ` [Qemu-devel] [PATCH v2 00/16] target/xtensa: switch to libisa no-reply

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='CAFEAcA9nZL+aTSRsjzweZm=mZh5-QAUS2y0CGeC-auRfhe3EvA@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=jcmvbkbc@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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 NNTP newsgroup(s).